Error when setting YAxis Minimum/Maximum

Found a possible bug in LightningChart? Report it here.

Moderator: Queue Moderators

Post Reply
MathiasParge
Posts: 3
Joined: Sat Nov 29, 2014 3:54 pm

Error when setting YAxis Minimum/Maximum

Post by MathiasParge » Sat Nov 29, 2014 3:59 pm

Hello,

I think I found a bug. The charts hangs when I'm trying to set the minimun or maximum of a second Y-Axis in Code (it works for YAxes[0]).

It is easy to reproduce this bug by extending the ExampleSeveralAxesXY Code-Behind by adding a button and this Click-Handler:

private void Button_Click(object sender, RoutedEventArgs e)
{
m_chart.BeginUpdate();
m_chart.ViewXY.YAxes[1].Minimum = 0;
m_chart.ViewXY.YAxes[1].Minimum = 1000;
m_chart.EndUpdate();
}

Best regards
Mathias

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Error when setting YAxis Minimum/Maximum

Post by ArctionPasi » Sat Nov 29, 2014 5:38 pm

Hi Mathias,

if calling it like that, it hangs in infinite loop. I haven't traced the problem but it definitely shouldn't do that.

Please set the Maximum instead of minimum second time
m_chart.BeginUpdate();
m_chart.ViewXY.YAxes[1].Minimum = 0;
m_chart.ViewXY.YAxes[1].Maximum = 1000;
m_chart.EndUpdate();

Then it works.

Yet better is to use
m_chart.BeginUpdate();
m_chart.ViewXY.YAxes[1].SetRange(0,1000);
m_chart.EndUpdate();
LightningChart Support Team, PT

MathiasParge
Posts: 3
Joined: Sat Nov 29, 2014 3:54 pm

Re: Error when setting YAxis Minimum/Maximum

Post by MathiasParge » Sat Nov 29, 2014 9:20 pm

Hi Pasi,

you are right, my example was wrong. It is not that easy to reproduce my error.

In my application the YAxis Minimum is NaN and then it ends up in the same infinite loop, but I don't now why it is NaN.

I will try to create a small code example.

Best regards
Mathias

MathiasParge
Posts: 3
Joined: Sat Nov 29, 2014 3:54 pm

Re: Error when setting YAxis Minimum/Maximum

Post by MathiasParge » Sat Nov 29, 2014 9:34 pm

Hello Pasi,

using SetRange() solved my problem at the moment ... thank you

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Error when setting YAxis Minimum/Maximum

Post by ArctionPasi » Wed Dec 03, 2014 12:10 am

Fixed in 6.3.1 today...
LightningChart Support Team, PT

Post Reply