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

Need help in implementing some specific function to your LightningChart Ultimate powered application? Post a question and get code snippets from other LightningChart Ultimate community members.

Moderator: Queue Moderators

Post Reply
jval
Posts: 40
Joined: Mon May 04, 2015 1:46 pm

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

Post by jval » Fri May 08, 2015 10:01 am

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 9824 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.

User avatar
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

Post by ArctionPasi » Sat May 09, 2015 4:53 pm

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...
LightningChart Support Team, PT

jval
Posts: 40
Joined: Mon May 04, 2015 1:46 pm

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

Post by jval » Mon May 11, 2015 9:19 am

Thank you, I'll try it.

Post Reply