Axis Inverted does not invert series properly

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Axis Inverted does not invert series properly

Post by amol » Mon Aug 31, 2015 10:46 am

Hi Steema Support,

We are creating line using series and setting property "line.Stairs=True;" and "line.VertAxis = VerticalAxis.Right;".
But we press button "Invert" to invert bottom axis but it does not shows reflection on line properly as shown in Fig. 2

Fig 1: shows line without axis inverted.
Fig 1.png
Fig 1
Fig 1.png (9.66 KiB) Viewed 7399 times
Fig 2: shows line with axis inverted.
Fig 2.png
Fig 2
Fig 2.png (9.98 KiB) Viewed 7394 times
Thanks
PlanoResearch
ManageAxis.rar
Demo File
(58.41 KiB) Downloaded 665 times

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

Re: Axis Inverted does not invert series properly

Post by Christopher » Mon Aug 31, 2015 1:30 pm

Hello,

I'm not sure that this is a defect. Have a look at this code:

Code: Select all

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      Line series = new Line(tChart1.Chart);
      series.FillSampleValues(3);
      series.Stairs = true;

      Annotation tool = new Annotation(tChart1.Chart);
      for (int i = 0; i < series.Count; i++)
      {
        tool.Text += " " + series.YValues[i].ToString();
      }
    }


    private void button4_Click(object sender, EventArgs e)
    {
      tChart1.Axes.Bottom.Inverted = !tChart1.Axes.Bottom.Inverted;
    }
the annotation tool prints out the three series values. As you can see, when the axis is inverted the shape of the line series changes, but this is not incorrect - the first YValue in the series is always correctly plotted.
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

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Axis Inverted does not invert series properly

Post by amol » Mon Aug 31, 2015 1:58 pm

Hi Steema Support,

Yes, you right when we see the value then it shows the correct value but line shown in the chart is not correctly inverted.
When line inverted correctlythen it looks like fig 1
fig 3.png
Fig1
fig 3.png (10.33 KiB) Viewed 7383 times
Thanks
PlanoResearch

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

Re: Axis Inverted does not invert series properly

Post by Christopher » Mon Aug 31, 2015 2:05 pm

Hello,
amol wrote: When line inverted correctlythen it looks like fig 1
That's right, and that's what it looks like using your data in a default chart, e.g.

Code: Select all

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      Line series = new Line(tChart1.Chart);
      //series.FillSampleValues(3);

      series.Add(10, 39);
      series.Add(50, 50);
      series.Add(59, 68);

      series.Stairs = true;

      Annotation tool = new Annotation(tChart1.Chart);
      for (int i = 0; i < series.Count; i++)
      {
        tool.Text += " " + series.YValues[i].ToString();
      }
    }


    private void button4_Click(object sender, EventArgs e)
    {
      tChart1.Axes.Bottom.Inverted = !tChart1.Axes.Bottom.Inverted;
    }
one or other of your chart modifications must be overriding the default behaviour of the chart.
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

Post Reply