Scrolling Axes Labels

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
dpatch
Newbie
Newbie
Posts: 53
Joined: Mon Jul 02, 2007 12:00 am

Scrolling Axes Labels

Post by dpatch » Fri Jun 25, 2010 4:39 pm

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?

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Scrolling Axes Labels

Post by Yeray » Mon Jun 28, 2010 2:40 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

dpatch
Newbie
Newbie
Posts: 53
Joined: Mon Jul 02, 2007 12:00 am

Re: Scrolling Axes Labels

Post by dpatch » Tue Jun 29, 2010 7:52 pm

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
Strip Example.zip
(8.95 KiB) Downloaded 1102 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Scrolling Axes Labels

Post by Narcís » Thu Jul 01, 2010 10:48 am

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.
Attachments
Strip Example.zip
(6.35 KiB) Downloaded 688 times
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

dpatch
Newbie
Newbie
Posts: 53
Joined: Mon Jul 02, 2007 12:00 am

Re: Scrolling Axes Labels

Post by dpatch » Thu Jul 01, 2010 4:33 pm

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!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Scrolling Axes Labels

Post by Narcís » Fri Jul 02, 2010 11:26 am

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);
Attachments
Strip Example.zip
(6.36 KiB) Downloaded 687 times
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

dpatch
Newbie
Newbie
Posts: 53
Joined: Mon Jul 02, 2007 12:00 am

Re: Scrolling Axes Labels

Post by dpatch » Sat Jul 03, 2010 7:28 pm

Narcis,

Now you know why I always kept your email address. It looks like this absoultely solved my problem.

Thank you very much!!!

dave

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Scrolling Axes Labels

Post by Narcís » Mon Jul 05, 2010 7:16 am

Hi Dave,

Je je. You're very welcome!!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply