Page 1 of 1
Scrolling Axes Labels
Posted: Fri Jun 25, 2010 4:39 pm
by 10545848
Good day,
I am using a TColorGridSeries to generate a scrolling color plot. My X axis values are aximuth values from 0 to 360, and I display 100 angles at a time. Once the 1st hundred are displayed, I redraw the axis labels, shifting old values to the left and adding a new value to the end (right). Everything works fine until I have a zero crossing. I think the problem is when I call Chart1.Axes.Bottom.SetMinMax(min, max). Since max cannot be less then min. For example, my left most axis value may be 250 and the right most might be 0.
I have the following code set:
Chart1[0].VertAxis := aBothVertAxis;
Chart1[0].HorizAxis := aBothHorizAxis;
Chart1.Axes.Top.OtherSide := False;
Chart1.Axes.Right.OtherSide := False;
Chart1.Series[0].IrregularGrid := False
Now I can call AddXYZ with X and Z parameters set as integers then, set the axis labels like this:
Chart1.Axes.Top.SetMinMax(Min, Max);
Chart1.Axes.Bottom.Items.add(BlkCnt-1,Format('%-.2f',[PlotParam.AngleData[High(PlotParam.AngleData)]]));
This all works fine until the zero crossing occurs. Is there a way to just set the lables without having to call SetMinMax?
Re: Scrolling Axes Labels
Posted: Mon Jun 28, 2010 2:40 pm
by yeray
Hi dpatch,
It would be helpful if you could arrange a simple example project we can run as-is to reproduce the situation here because right now I'm not sure about how are you exactly populating your series, how are you redrawing the labels, shifting the old values,...
Thanks in advance.
Re: Scrolling Axes Labels
Posted: Tue Jun 29, 2010 7:52 pm
by 10545848
Here is a simple example that shows what I am trying to do. I have sample data, but makes the upload too big. Is there an email address I can send it to?
Thanks in advance,
dave
Re: Scrolling Axes Labels
Posted: Thu Jul 01, 2010 10:48 am
by narcis
Hi dave,
I have modified your project a little bit. I removed custom labels, used point labels and also set axes to be automatic. Doing so I now get labels all the time. However, this may not be what you are looking for. Could you please have a look at the example and let me know where you'd like to go from here? Or am I completely in the wrong way?
Thanks in advance.
BTW: Files may also be posted at
our upload page.
Re: Scrolling Axes Labels
Posted: Thu Jul 01, 2010 4:33 pm
by 10545848
Narcis,
Thanks for your fast response!
I see what you did and it looks good. But, how come once the scrolling begins, the x axis labels go from showing many at the defined increment to only one on the far left?
Also, you made a call to Chart1[0].Clear instead of clearing the individual values. I have always thought that this call has a bug. When you call Chart1[0].Clear, it clears all the setup you have previously done...like setting the color palette. Is there another way to clear the plot display without loosing the plot setup?
Thanks again!
Re: Scrolling Axes Labels
Posted: Fri Jul 02, 2010 11:26 am
by narcis
Hi dpatch,
Thanks for your fast response!
You're welcome!
I see what you did and it looks good. But, how come once the scrolling begins, the x axis labels go from showing many at the defined increment to only one on the far left?
I think I have found the problem. When scrolling begins, in the code, you wrote:
Code: Select all
//...Clear previous 100 columns values in the chart.
But you implemented this:
Code: Select all
(Chart1.Series[0] as TColorGridSeries).XValues.Delete(0, (Chart1.Series[0] as TColorGridSeries).XValues.Count);
(Chart1.Series[0] as TColorGridSeries).YValues.Delete(0, (Chart1.Series[0] as TColorGridSeries).YValues.Count);
(Chart1.Series[0] as TColorGridSeries).ZValues.Delete(0, (Chart1.Series[0] as TColorGridSeries).ZValues.Count);
This means all series values are clearead at each loop! Changing code above for line below solves the problem .
Code: Select all
//...
//...Clear previous 100 columns values in the chart.
//...
Chart1[0].Delete(0, fChartSteps);
Is that what you were looking for? I attach full project as well.
Also, you made a call to Chart1[0].Clear instead of clearing the individual values. I have always thought that this call has a bug. When you call Chart1[0].Clear, it clears all the setup you have previously done...like setting the color palette. Is there another way to clear the plot display without loosing the plot setup?
Ok, I see. I don't think it's a bug but it clears all series ValueLists, colors included. I was trying to simplify the code, so this would also do the job:
Code: Select all
Chart1[0].Delete(0, Chart1[0].Count);
Re: Scrolling Axes Labels
Posted: Sat Jul 03, 2010 7:28 pm
by 10545848
Narcis,
Now you know why I always kept your email address. It looks like this absoultely solved my problem.
Thank you very much!!!
dave
Re: Scrolling Axes Labels
Posted: Mon Jul 05, 2010 7:16 am
by narcis
Hi Dave,
Je je. You're very welcome!!