Page 1 of 1

How to fix/attach asix X at zero on asix Y

Posted: Fri May 08, 2015 10:01 am
by jval
Hello.
I use LightningChart for WinForms and I need to fix asix X at zero on asix Y.
You can see what I want to reach on the attached screenshot
fixed zero question 1.jpg
fixed zero question 1.jpg (49.78 KiB) Viewed 9850 times
Could you give me some advice about it?
I've done it with Postion property changing but it's very complicated way, I think.
I hope in LC we can find more simple solution :)

Thank you in advance.

Re: How to fix/attach asix X at zero on asix Y

Posted: Sat May 09, 2015 4:53 pm
by ArctionPasi
Hi :P

You can do this most easily like this:

m_chart.ViewXY.AxisLayout.XAxisAutoPlacement = XAxisAutoPlacement.Off;
m_chart.ViewXY.XAxes[0].VerticalAlign = AlignmentVertical.Center;
m_chart.ViewXY.YAxes[0].RangeChanged += new AxisBase.RangeChangedHandler(ExamplePointLineSeriesXY_RangeChanged);

void ExamplePointLineSeriesXY_RangeChanged(double newMin, double newMax, AxisBase axis, ref bool cancelRendering)
{
cancelRendering = true;
double trackLevel = 0;
m_chart.ViewXY.XAxes[0].Position = (newMax - trackLevel) / (newMax-newMin) * 100.0;
}

[/code]

I hope this helps...

Re: How to fix/attach asix X at zero on asix Y

Posted: Mon May 11, 2015 9:19 am
by jval
Thank you, I'll try it.