cancel
Showing results for 
Search instead for 
Did you mean: 

iCharts scaling and intervals MII 11.5

Former Member
0 Kudos

I have an iChart (Line graph) that I have four pens, all of which have the auto scale is not checked. I have the global range checked and I set the min and max. The problem I have is the intervals from 100 (min) to 350 (max). How can I set it so it is every 10 or 15 or 25? The default for this is 25 when I set the YaxisMajorTickCount to 20. Since I do not know how to modify the intervals, I played around the tick counts.

document.Chart2.getChartObject().setGlobalMinRange(100);

document.Chart2.getChartObject().setGlobalMaxRange(350);

document.Chart2.getChartObject().setUseGlobalRanges(true);

document.Chart2.getChartObject().setGlobalAutoScale(false);

document.Chart2.getChartObject().setGlobalServerScaling(false);

document.Chart2.getChartObject().setYAxisMajorTickCount(20);

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chip,

I did some experimenting - I figured there must be some underlying mathematical calculation involved that determines the intervals, and since I can't see the actual code behind it, this is what I came up with.

It looks to be a formula like this: 2(range) / desired interval. So, in your case, the range 100 - 350 yields 250, and say you want the intervals to be by tens.

2(250) / 10 = 500 / 10 = 50. So if you set the YAxisMajorTickCount to 50, the chart shows intervals by tens. Intervals of 15 are a bit more challenging, since 500 is not evenly divisible by 15. So I adjusted the range to 100 - 370 and got the intervals by 15.

Anyrate, maybe this is just crazy talk, but try it and let me know if it works for you

Kind Regards,

Diana Hoppe

Former Member
0 Kudos

I changed the chart settings and the intervals are now 11 not 15 like your results. However, changing the YAxisMajor from 50 to 35 did change the interval to 15 - 16 respectively.

document.Chart2.getChartObject().setGlobalMinRange(100);

document.Chart2.getChartObject().setGlobalMaxRange(370);

document.Chart2.getChartObject().setUseGlobalRanges(true);

document.Chart2.getChartObject().setGlobalAutoScale(false);

document.Chart2.getChartObject().setGlobalServerScaling(false);

document.Chart2.getChartObject().setYAxisMajorTickCount(50);

Former Member
0 Kudos

Hi Chip,

Looking at your code snippet, 2*270 = 540, which is not divisible by 50. But, if you change the YAxisMajorTickCount to 36, you should see the interval by intervals of 15, since 540/15 = 36 (36 being a whole number).

In other words, the range * 2 must be divisible by the desired inteval amount. Hope this makes sense.

Diana

Former Member
0 Kudos

Thanks. I will keep this in mind.

Answers (0)