Line Chart Y-Axis Maximum Value not getting set properly

Charts for WPF Forum

Posted 6 years ago by Jerin Sebastian
Version: 17.2.0665
Platform: .NET 4.7
Environment: Windows 10 (64-bit)
Avatar

Am trying to set XYDoubleAxis Maximum value as 200, Minimum value as 0 and TickMajorInterval as 10, but the chart am getting is:

https://drive.google.com/open?id=1Cu06NECCQmMYJ3Dn0q4YidzLTW6LKZrr

<charts:XYChart.YAxes>
<charts:XYDoubleAxis Minimum="0" Maximum="200" AreLabelsVisible="True" AreMajorTicksVisible="True" AreMinorTicksVisible="True" TickMajorInterval="10" TickMinorInterval="0" />
</charts:XYChart.YAxes>

Comments (10)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jerin,

Can you email our support address a new simple sample project showing this?  Then we can debug with it.  Please reference this thread in your email.  We are very close to a 2018.1 release so the sooner you can do this the better in case any changes would be needed for it.  Be sure to exclude any bin/obj folders from the ZIP you send, and rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jerin,

Thanks for the sample.  What's happening is that the chart has a default PaddingPercentage on it that adds some padding around the outside of the chart area.  This ends up effectively showing a tick above/below your min/max and with your major interval setting, it's causing those ticks to get labels too.

One way around it would be to remove the padding percentage and add a little margin so the labels don't get clipped:

lc.PaddingPercentage = new Thickness(0);
lc.Margin = new Thickness(10);


Actipro Software Support

Posted 6 years ago by Jerin Sebastian
Avatar

The problem still persist when the values are set as below

yAxis.TickMajorInterval = 35;
yAxis.Maximum = 250;
Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jerin,

Did you add the lines from my last reply above?  When I do that, the 250 maximum seems to render fine.


Actipro Software Support

Posted 6 years ago by Jerin Sebastian
Avatar

Yes, I added those previous lines. Did you set the interval as 35?

This is what am getting

https://drive.google.com/open?id=1QbnruSTwru5CbX1E3aNzNYcLuBdip9_y

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Yes I used both lines you pasted and it seemed to render ok as long as I also had the lines I had pasted.  Note that I'm testing this on the 2018.1 version.

Sorry but the screenshot link you posted didn't seem to be public.

If you still can't sort it out, please make a new simple sample that shows it and send that to our support address and we'll see what's going on.  In your e-mail, reference this thread and remove any bin/obj folders from the ZIP you send.  Thanks!


Actipro Software Support

Posted 6 years ago by Jerin Sebastian
Avatar

Please check the below link again.

https://drive.google.com/open?id=1QbnruSTwru5CbX1E3aNzNYcLuBdip9_y

it seems like Maximum and minimum values are displayed correctly only if they are the multiple of TickMajorInterval.

I have used the 2018.1 version and the problem seems to persist with set of values

-------------------------------------------------

yAxis.TickMajorInterval = 35;

yAxis.Maximum = 250;

yAxis.Minimum=0;

---------------------------------------------------

yAxis.TickMajorInterval = 80;

yAxis.Maximum = 1000;

yAxis.Minimum=200;

---------------------------------------------------

I have attached the link of the sample project below. Please check.

https://drive.google.com/open?id=15FgyKLSsxuEVUh7-AbPpmG2sREyjgypQ

Could you please send a screenshot of your output?

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jerin,

Thanks for the screenshot.  What you posted is what I saw as well.  That looks correct to me since the ticks and tick labels only render on major intervals.  You can see the 245 (which is a multiple of 35 and is therefore a major interval) tick and tick label render fine, and the top of the chart renders at 250 (a few pixels above the 245 major interval in this chart), which is the maximum you set.  From the screenshot, it appears to be rendering as designed.  What specifically were you looking for instead?


Actipro Software Support

Posted 6 years ago by Jerin Sebastian
Avatar

I was expecting it to show 250 on top of the chart.

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jerin,

I'm sorry, but it's not set up to do that at this time.  The logic only has it rendering tick labels on major intervals, so you'd have to set the maximum to a multiple of 35 that is the same or next interval past the maximum data value.


Actipro Software Support

The latest build of this product (v24.1.2) was released 3 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.