Page 1 of 1
Axis Inverted does not invert series properly
Posted: Mon Aug 31, 2015 10:46 am
by 9526439
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
- Fig 1.png (9.66 KiB) Viewed 7403 times
Fig 2: shows line with axis inverted.
- Fig 2
- Fig 2.png (9.98 KiB) Viewed 7398 times
Thanks
PlanoResearch
Re: Axis Inverted does not invert series properly
Posted: Mon Aug 31, 2015 1:30 pm
by Christopher
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.
Re: Axis Inverted does not invert series properly
Posted: Mon Aug 31, 2015 1:58 pm
by 9526439
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
- Fig1
- fig 3.png (10.33 KiB) Viewed 7387 times
Thanks
PlanoResearch
Re: Axis Inverted does not invert series properly
Posted: Mon Aug 31, 2015 2:05 pm
by Christopher
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.