IssioDev

Doesn't display 0 y-axis label on mscombi2d with odd max value

Recommended Posts

When using an mscombi2d chart with y-axis values:

        'AxisMinValue: 0,
        yAxisMaxValue: someOddValue

The zero value for the y-axis is not displayed. If the yAxisMaxValue is even then it is displayed. In fact this happens whenever the scale is not a multiple of the gap, ie: min: 0, max 13.

This is new to 3.13.x

Screen Shot 2018-10-24 at 6.06.50 PM.png

Screen Shot 2018-10-24 at 6.06.58 PM.png

Screen Shot 2018-10-24 at 6.08.19 PM.png

Share this post


Link to post
Share on other sites

Hi,

 

The horizontal divisional lines are placed on equal intervals against the y-axis scale. For example : 0, 2, 4, 6, 8, 10,.... or 0, 5, 10, 15,....

You can set the y-axis limits using the attributes "yAxisMaxValue" and "yAxisMinValue", along with the number of div lines you want in between those limits using "numDivLines". These number of divisional lines would be dividing the y-axis in equal intervals. Please refer to the below documentation link for :

Chart limit configuration : https://www.fusioncharts.com/dev/chart-guide/chart-configurations/chart-limits

Div line configuration : https://www.fusioncharts.com/dev/chart-guide/chart-configurations/div-lines-and-grids

Also find a sample fiddle for reference :

http://jsfiddle.net/xb9TG/2642/

Please note : If you do not set the attributes mentioned above, the internal algorithm sets a good-looking y-axis range and intervals based on the data values provided.

Default : http://jsfiddle.net/xb9TG/2639/

 

However, if you still face the problem, kindly provide a sample fiddle with your dataSource, and also let us know which version of FusionCharts are you using, so that we can check the same at our end and assist you accordingly.

 

Thanks,

Akash.

Share this post


Link to post
Share on other sites

Here you go.... https://jsfiddle.net/f87az9ec/

Note that there is no 0K on the scale if you set the "yAxisMaxvalue": 11 whereas there is when you set it to 10. Only seems to happen with odd values, not even values.

v3.12 didn't have this problem but 3.13 does.

Edited by IssioDev

Share this post


Link to post
Share on other sites

3.13.2-sr1 seems a little better that 3.12.2 in this regard but still has problems we "odd" values of y-axis. "Even" values always work just fine.

Share this post


Link to post
Share on other sites

Hi,

 

Check this modified sample setting an attribute "adjustDiv" to "0" to disable the automatic internal divisional line algorithm :

https://jsfiddle.net/f87az9ec/3/

 

Please note :This would work in all the versions as you are setting the limits manually, you need to disable the internal div calculation.

For further reference, please check the documentation link already provided in the earlier post that explains the above in details :

https://www.fusioncharts.com/dev/chart-guide/chart-configurations/div-lines-and-grids

 

Thanks,

Akash.

Share this post


Link to post
Share on other sites

I think you are saving that you broke it in 3.13 and here is the workaround. You know this works in all versions prior to 3.13 don't you?

All in all I can work with this, it is disappointing though that the "automatic internal divisional line algorithm" has broken but I can turn it off and replicate the work that your algorithm is doing myself.

Displaying the 0 on the y-baseline shouldn't really be a function of the "automatic internal divisional line algorithm" which really is the point isn't it.

Share this post


Link to post
Share on other sites

Hi,

 

In any of the versions, when you are setting the "yAxisMinValue" or "yAxisMaxValue" explicitly all you need to do is to first set the adjustDiv attribute to 0 to disable the automatic adjustment of divisional lines, as stated in the documentation shared in the earlier response.

image.thumb.png.0c212965493c3b5b83eeb5743de85336.png

Please note : Without setting the "adjustDiv" to "0", if you set any of the above attributes to customize the axis limits or div intervals, it may not work properly. Which is the case for your instance.

As you have not set the attribute "adjustDiv" to "0" in your chart dataSource(provided in your sample - https://jsfiddle.net/f87az9ec/), but you have manually set the limits the result is unexpected. The "adjustDiv" attribute is provided for this purpose when a user wants to set the limits explicitly, it has to be disabled first.

Working sample with adjustDiv set to "0" : https://jsfiddle.net/f87az9ec/3/

Hope this helps.

 

Thanks,

Akash.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now