Axis logarithm is not working correctly on values between 0 and 1

Posted by: yifan_zhang on 19 September 2017, 2:21 pm EST

  • Posted 19 September 2017, 2:21 pm EST

    The logarithm for axis is not working correctly when the value is between 0 and 1. See this fiddle:http://jsfiddle.net/cxt6p217/2/. Neither fraction number or other type of 1/x works. Only 1/i is test fine in that fiddle. Please help me with this issue.
  • Replied 22 September 2017, 8:35 am EST

    Hi,
    We are sorry for the delay.

    You need to set bindingX for FlexChart, not for series. Please find the updated fiddle[1].

    Thanks,
    Manish Kumar Gupta

    [1] http://jsfiddle.net/mkgupta911/cxt6p217/3/
  • Replied 25 September 2017, 7:54 pm EST

    Thanks for the updates. It does work for logarithm. But the auto calculated axis max seems to be incorrect, especially when log is disabled. The chart is badly squeezed. Can you help me with that? Thank you.
  • Replied 26 September 2017, 3:20 am EST

    Hi,
    You can set axis min and max property for that. Please refer to the updated fiddle for the same:
    http://jsfiddle.net/mkgupta911/cxt6p217/7/

    Thanks,
    Manish Kumar Gupta
  • Replied 26 September 2017, 2:26 pm EST

    Thanks for the reply. I know about setting the min/max. I was just wondering why the auto calculated axis min/max is not working.

    I have encountered another issue with log, when the chartType is specified in series, the log on Y axis will not work for fraction number. See this fiddle: http://jsfiddle.net/cxt6p217/9/. If you remove the chartType in series, you shall see it works again. So I looked up in the code and I do located the bug: In chart.js, function _DataInfo.prototype.analyse,
    if (logy) {
    if (isRotated)
    this.minX = isNaN(this.minXp) ? 1 : this.minXp;
    else
    this.minY = isNaN(this.minYp) ? 1 : this.minYp;
    }

    However, minYp will always be NaN when the chartType is specified in series, because of
    var custom = series.chartType !== undefined; this._parseYVal(val, xval, custom, stackAbs, stackPos, stackNeg);

    I think that custom in parseYVal very likely should be customY, or the code for calculating minYp should be changed.
    Please let me know when the bug can be fixed. Thank you.
  • Replied 28 September 2017, 4:27 pm EST

    Any updates on the bug?
  • Replied 29 September 2017, 12:49 am EST

    Hi,
    The axisX value gets calculated correctly as expected with build 5.20172.334, please refer to the fiddle[1] for the same.

    Thanks for reporting the issue and sample. We are able to replicate the issue at our end and it looks like a bug. Hence, this issue has been forwarded to the concerned team for further investigation with internal tracking id 289381.

    If you specify axisY for series, series will be rendered. In the meantime, please use this as a workaround. Please refer to the fiddle [2] [3] for the same.

    Thanks,
    Manish Kumar Gupta

    [1] http://jsfiddle.net/mkgupta911/cxt6p217/10/
    [2] http://jsfiddle.net/mkgupta911/cxt6p217/13/
    [3] http://jsfiddle.net/mkgupta911/cxt6p217/11/
  • Replied 3 October 2017, 12:23 am EST

    Thanks for the reply and I really appreciate your help. I can see that workaround works as expected. However, that axisY specified might be a little troublesome for our system. So it would be great if that issue can be fixed as soon as possible. Thank you.
  • Replied 15 November 2017, 6:39 pm EST

    I can see that this issue seems to be fixed in the latest 173.380 build. Can you confirm that with me? Thanks.
Need extra support?

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

Learn More

Forum Channels