Flexchart Y-Axis labels

Posted by: phill_dutton on 11 December 2020, 6:19 am EST

  • Posted 11 December 2020, 6:19 am EST

    Hopefully this is a simple question to resolve.

    We are displaying 2 data series in a flexchart but we have noticed that the Y-Axis labels look a bit strange with a limited data set.

    In certain instances we have 2 items in our data set with a value of 0 and 1 for the series. i.e.:

    [{ date: ‘12/01/2020’, series1: 0, series2: 0 },

    { date: ‘12/09/2020’, series1: 1, series2: 0 }]

    What happens is the dates are shown accross the x-axis correctly, but the y-axis contains duplicate 0 and 1 values

  • Posted 16 December 2020, 6:07 am EST

    Hi Phil,

    I am not sure what exactly the cause could be since I am unable to replicate this at my end. I have attached a sample where this works correctly.

    You may also modify the sample to replicate the issue and send it back to us, so that we can investigate this further.

  • Posted 16 December 2020, 6:07 am EST

  • Posted 16 December 2020, 7:23 am EST

    Thanks for your reply. I figured out what the issue was, in our code we were using an itemFormatter on the y axis to show integer values.

    I tried removing this and the values displayed as decimals from 0 to 1 in 0.1 increments. The problem is we only want to see integer values on the Y axis, if I try setting the format property on the axisY to ‘N0’ this recreates the issue we are seeing with our itemFomatter.

  • Posted 18 December 2020, 5:01 am EST

    Hi,

    In this case you may set the step value using the majorUnit property of the axis. Please refer to the following code snippet and the sample demonstrating the same:

    chart.axisY.majorUnit = 1;
    

    https://codesandbox.io/s/wijmo-starter-forked-tv1nh?file=/src/index.js

    Regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels