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
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.
How to fix/attach asix X at zero on asix Y
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: How to fix/attach asix X at zero on asix Y
Hi
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...
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...
LightningChart Support Team, PT
Re: How to fix/attach asix X at zero on asix Y
Thank you, I'll try it.