Plotting x-axis samples in descending order

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
BenW
Advanced
Posts: 119
Joined: Wed Aug 10, 2005 4:00 am

Plotting x-axis samples in descending order

Post by BenW » Tue Mar 25, 2014 1:57 pm

Hi.

I have version 2.0 of Steema. Is it possible to plot X,Y double values such that from left to right the x-axis labels are displayed in descending order?

So for example if I have four X,Y samples as follows:

X Y
100 20
60 24
0 30
-50 22

then the x-axis labels would be shown (from left to right) starting at 100 and ending at -50.

Thanks,
Ben.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Plotting x-axis samples in descending order

Post by Christopher » Wed Mar 26, 2014 9:06 am

Hi,
BenW wrote:then the x-axis labels would be shown (from left to right) starting at 100 and ending at -50.
You could invert the bottom axis, e.g.

Code: Select all

    Line series;
    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      series = new Line(tChart1.Chart);
      series.Add(100, 20);
      series.Add(60, 24);
      series.Add(0, 30);
      series.Add(-50, 20);
    }

    private void button1_Click(object sender, EventArgs e)
    {
      tChart1.Axes.Bottom.Inverted = !tChart1.Axes.Bottom.Inverted;
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

BenW
Advanced
Posts: 119
Joined: Wed Aug 10, 2005 4:00 am

Re: Plotting x-axis samples in descending order

Post by BenW » Wed Mar 26, 2014 2:56 pm

Wow thanks Christopher - easy once you know how!

Are there any gotcha's with inverting the axis in the manner?

I tried panning, zooming and using the CursorTool to retrieve the X,Y value information (cursortool line is configured as vertical only), being derived from this seems accurate.

Regards,
Ben.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Plotting x-axis samples in descending order

Post by Christopher » Wed Mar 26, 2014 3:02 pm

Hello!
BenW wrote:Are there any gotcha's with inverting the axis in the manner?
No, not that I know of. If there is a problem, then it should be fixed. Do please let me know if you come across something you don't see as correct.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

BenW
Advanced
Posts: 119
Joined: Wed Aug 10, 2005 4:00 am

Re: Plotting x-axis samples in descending order

Post by BenW » Wed Mar 26, 2014 4:52 pm

Cool...

Thanks Christopher!

Ben.

Post Reply