jQuery UI Widgets Forums Chart Y Axis value repeated multiple times

This topic contains 5 replies, has 4 voices, and was last updated by  Christopher 6 years, 10 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Y Axis value repeated multiple times #86502

    Rasul Gani Sheikh
    Participant

    Hello sir

    I am using jxqchart with
    Y axis auto
    decimal place 5
    my y axis repeated multiple times. Please see link below

    http://jsfiddle.net/UX2c6/694/

    I dont want to min and max Y axis value and unit interval.

    Y Axis value repeated multiple times #86528

    Christopher
    Participant

    Hi Rasul Gani Sheikh,

    The Y axis isn’t repeating. If you change the property “decimalPlaces” to 6 you will notice that the values are actually different.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com

    Y Axis value repeated multiple times #94542

    I want to keep decimal places 5 as it is. And also don’t want to show repeated value on y axis label axix. I tried by round up the value but problem remain same.

    Y Axis value repeated multiple times #94563

    Christopher
    Participant

    Hi dharilkothari@gmail.com,

    Rounding up the numbers won’t make any difference because the numbers themselves are different only after their 5th preciison point. Mathematically you can’t show different values when they are the same until their 6th precision number. The only solution to see the difference between the numbers is if you use a bigger precision ( decimal places > 5), or use different values that have bigger differences.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com

    Y Axis value repeated multiple times #95364

    Kapil
    Participant

    Is there any option to hide repeated value. Only show the distinct values on y axis. We cant increase the decimal precision because this is endless. If in future value gets small in that case this idea again apply that increase decimal position which is only rework again and again.
    Please reply.

    • This reply was modified 6 years, 10 months ago by  Kapil.
    Y Axis value repeated multiple times #95376

    Christopher
    Participant

    Hi kapiljain,

    Yes there is a way to acomplish that. You can use the formatFunction(value) property of the valueAxis to check if the value is already drawn and return an empty string instead of the value. You can create a global variable of type array to cache the values that already have been drawn and check the new values agains it. Here’s an example of a format function:

    
    formatFunction: function (value) {
       if (values.indexOf(value) > -1) {
           return '';
       }
    
       values.push(value);
           return value;
       }
    

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.