You can change at runtime with TChart function

*ChangeSeriesTyp(..)*

Solved

Posted on 2014-07-15

Is it possible to draw unconnected points in a line series of a TChart ? Can I turn off the automatic connecting of points drawn using AddXY ?

21 Comments

You can change at runtime with TChart function

Twosmallcharts.jpg

When I click on the panel I get this message: Mdiapp Access Violation at address 40340000. Read of address 40340000".

What is going on here ?

Can you please provide a small example project, so that I can get this issue reproduced?

Or better, you may consult Steema TeeChart support...

Steema Support Central

Here is the .pas file

ChartTest2.pas

ChartTest2.pas

Series indexes always start with '0' not with '1!!!

Because you have created just one point series at design time, you have to reference it with index '0' as follows:

After having corrected this error, I tried out AddXY(..) in relation with point series.

I cannot identify any problems and there are no zigzag lines either!

So please try yourself, if you can reproduce your problem with that demo app and tell me how you did...

Could you please explain that?

I've never heard of a function

// ***FullSpeedPan***********

// Chart1.Series[5].AddNullXY

TimesThroughLoop := 0;

Days := 0;

LastDays := 0;

while TimesThroughLoop < FullSpeedPanFrames do

Begin

TimesThroughLoop := TimesThroughLoop + 1;

TestInt := TestInt + 1;

If PanDirection = 0 then

RunningDegrees := RunningDegrees + (PanStepsFrame * PanDegreesStep)

else

RunningDegrees := RunningDegrees - (PanStepsFrame * PanDegreesStep);

RunningS := (RunningS + FrameIntervalTotalSec);

if RunningS > 59 then

Begin

RunningM := RunningM + (RunningS div 60);

RunningS := (RunningS mod 60);

End;

If RunningM > 59 then

Begin

RunningH := RunningH + (RunningM div 60);

RunningM := (RunningM mod 60);

End;

DecimalTime := (RunningH + (RunningM / 60));

While DecimalTime > 24 do // if we go over 24 hours

begin

Days := Days + 1;

DecimalTime := DecimalTime - 24; // fix hours

if FSPLOnlyOnceFlag = 0 then

begin

FSPLOnlyOnceFlag := 1;

Chart1.Series[5].AddNullXY

end;

Chart1.Series[4].AddNullXY

Chart1.Series[3].AddNullXY

//Memo1.Lines.Add(IntToStr

end;

If Days <> LastDays then // this prevents connecting end of one line to start of next when hrs go over repeatedly

begin

Chart1.Series[5].AddNullXY

IterationTest := IterationTest + 1;

Memo1.Lines.Add(IntToStr(D

end;

AdjustedRunningDeg := RunningDegrees;

if RunningDegrees < 0 then // this fixes running degrees if it goes under

begin

AdjustedRunningDeg := RunningDegrees + 360;

Chart1.Series[3].AddNullXY

end;

if RunningDegrees > 360 then // this fixes running degrees if it goes over

begin

AdjustedRunningDeg := RunningDegrees - 360;

Chart1.Series[3].AddNullXY

end;

// Chart1.Series[4].AddNullXY

Chart1.Series[3].AddXY(Adj

Chart1.Series[3].AddNullXY

PLastPlotCentPntXC := AdjustedRunningDeg;

PLastPlotCentPntYC := DecimalTime;

AdjustedRunningDeg := RunningDegrees;

if (RunningDegrees - (LensFOV / 2)) < 0 then // this fixes running degrees if it goes under

begin

AdjustedRunningDeg := RunningDegrees + 360;

if FSPLOnlyOnceFlag = 0 then // this doesn't seem to be helping

begin

FSPLOnlyOnceFlag := 1;

Chart1.Series[5].AddNullXY

end;

// Chart1.Series[5].AddNullXY

end;

if (RunningDegrees - (LensFOV / 2)) > 360 then // this fixes running degrees if it goes over

begin

AdjustedRunningDeg := RunningDegrees - 360;

// if FSPLOnlyOnceFlag = 0 then //not sure this is helping

// FSPLOnlyOnceFlag := 1;

// Chart1.Series[5].AddNullXY

// end;

// Chart1.Series[5].AddNullXY

end;

Chart1.Series[5].AddXY(Adj

if (PanDirection = 1) and (Days <> LastDays) then // this prevents connecting end of one line to start of next when hrs go over repeatedly during CCW

begin

Chart1.Series[5].AddNullXY

//Chart1.Series[4].AddNull

//Memo1.Lines.Add('if both ifs');

end;

//Chart1.Series[5].AddNull

PLastPlotCentPntXL := AdjustedRunningDeg - (LensFOV / 2);

PLastPlotCentPntYL := DecimalTime;

if FirstPointOnceOnlyFlagL = 0 then

begin

FirstPointXL := PLastPlotCentPntXL;

FirstPointYL := DecimalTime;

FirstPointOnceOnlyFlagL := 1;

end;

Chart1.Series[5].AddNullXY

// Chart1.Series[4].AddNullXY

// Chart1.Series[5].AddNullXY

AdjustedRunningDeg := RunningDegrees;

if (RunningDegrees + (LensFOV / 2)) < 0 then // this fixes running degrees if it goes under

begin

AdjustedRunningDeg := RunningDegrees + 360;

Chart1.Series[4].AddNullXY

end;

if (RunningDegrees + (LensFOV / 2)) > 360 then

// this fixes running degrees if it goes over

begin

AdjustedRunningDeg := RunningDegrees - 360;

Chart1.Series[4].AddNullXY

end;

Chart1.Series[4].AddXY(Adj

clGreen);

PLastPlotCentPntXR := AdjustedRunningDeg + (LensFOV / 2);

PLastPlotCentPntYR := DecimalTime;

If FirstPointOnceOnlyFlagR = 0 then

begin

FirstPointXR := PLastPlotCentPntXR;

FirstPointYR := DecimalTime;

FirstPointOnceOnlyFlagR := 1;

end;

Chart1.Series[4].AddNullXY

// Memo1.Lines.Add('B = ' + FloatToStr(CHSeriesB) + ' A = ' + FloatToStr(CHSeriesA) + ' C = ' + FloatToStr(CHSeriesC) + ' SL ' + FloatToStr(Edit3.SelLength

// Chart1.Repaint;

// Chart1.Refresh;

If TestInt = GraphSpeed then // redraws graph during full speed ramp loop to make it animated

Begin

Chart1.Update;

TestInt := 0;

End;

LastDays := Days;

Days := 0;

// Chart1.Invalidate;

End;

// Series3.AddNull('');

Panel71.Caption := FloatToStr(RunningH) + ':' + FormatFloat('00', RunningM)

+ ':' + FormatFloat('00', RunningS);

Chart1.Series[5].AddNullXY

Chart1.Series[4].AddNullXY

Chart1.Series[3].AddNullXY

// ***RampDown***************

You can see all the work I had to do with addnulls to stop connecting lines from being drawn. It occurs to me that the problems I have been having could all be related to my using the series number, instead of the series number minus one. This alone may solve my problems with TCharts. What I have been thinking is that I should remove the existing chart and relace it with a new one. Then I would add one or three point series, and change all the ADDXY's to the new series number(s). If all this works, I wonder this. Can I do what i want with only one series ? I was using different series before to help avoid connecting lines, and to have different colors for each line. Now I suspect I don't need to do that. What do you think ?

By clicking you are agreeing to Experts Exchange's Terms of Use.

Title | # Comments | Views | Activity |
---|---|---|---|

Using idhttp to login to instagram | 2 | 49 | |

Delphi selector screen | 2 | 45 | |

Copy Files - Python | 7 | 28 | |

groovy example issue | 10 | 32 |

Join the community of 500,000 technology professionals and ask your questions.

Connect with top rated Experts

**9** Experts available now in Live!