Search code examples
javascriptscalinghighchartshorizontal-scaling

HighCharts: Logarithmic Scale for Horizontal Bar Charts


I am working with HighCharts to produce a bar chart. My values can range from as minimal as 0 to as high as 100k (example). Therefore, one bar of the graph can be very small and the other can be very long. HighCharts has introduced the feature of "Logarithmic Scaling". The example of which can be seen HERE

My js code is written in this jsfiddle file. I want to display my horizontal axis (x-Axis) logarithmically. I have inserted the key type as shown in the example but the script goes into an infinite loop which has to be stopped.

What is the flaw in the execution or is logarithmic scaling for HighCharts still not mature?

P.S The commented line in jsfiddle is causing the issue


Solution

  • It is still experimental according to the Official Documentation, so that might be the case:

    "The type of axis. Can be one of "linear" or "datetime". In a datetime axis, the numbers are given in milliseconds, and tick marks are placed on appropriate values like full hours or days.

    As of 2.1.6, "logarithmic" is added as an experimental feature, but it is not yet fully implemented. Defaults to "linear".

    Try it: "linear", "datetime" with regular intervals, "datetime" with irregular intervals, experimental "logarithmic" axis."