Page 1 of 1

Plotting x-axis samples in descending order

Posted: Tue Mar 25, 2014 1:57 pm
by 9787981
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.

Re: Plotting x-axis samples in descending order

Posted: Wed Mar 26, 2014 9:06 am
by Christopher
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;
    }

Re: Plotting x-axis samples in descending order

Posted: Wed Mar 26, 2014 2:56 pm
by 9787981
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.

Re: Plotting x-axis samples in descending order

Posted: Wed Mar 26, 2014 3:02 pm
by Christopher
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.

Re: Plotting x-axis samples in descending order

Posted: Wed Mar 26, 2014 4:52 pm
by 9787981
Cool...

Thanks Christopher!

Ben.