This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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 ?

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get every solution instantly with premium.
Start your 7-day free trial.

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trialCould 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 ?

You can set different colors for the value markers as follows:

Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get every solution instantly with premium.
Start your 7-day free trial.

You can change at runtime with TChart function

ChangeSeriesTyp(..)