Search code examples
javascripthighchartsjpgraph

highcharts.js: static ticks spaced equally apart


Is it possible to have static tick marks equally apart even though the difference between the tick marks are not equal? For example here is how I have my yAxis set up in a column chart:

yAxis: 
{
    min: 0,
    title: 
    {
        text: 'Velocity (in/sec)'
    },
    labels: 
    {                           
        overflow: 'justify'
    },
    tickPositions: [0.01, 0.10, 1.00, 10.00]
}

I want 0.01-0.10 to take up 33% of the graph, 0.10-1.0 to take up 33%, and 1.0-10.0 to take up the remaining 34%, with the columns falling into place according to their values.

I have some JPGraphs that have this functionality and am hoping it can be transferred to highcharts.js.


Solution

  • Sounds like you just want a logarithmic axis.

        yAxis: {
            type: 'logarithmic',
            min: 0.01,
            max: 10
        },
    

    Here's a fiddle example.