highcharts.js: static ticks spaced equally apart

182 Views Asked by At

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.

2

There are 2 best solutions below

0
On BEST ANSWER

Sounds like you just want a logarithmic axis.

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

Here's a fiddle example.

0
On

AFAIK Highcharts does not support automatic creation of histograms, but you can add a category to the xAxis with the desired labels, and then create arrays of data to match these.

xAxis: {
            categories: ['0.01', '0.10', '1.00', '10.00']
        },
series: [{
            data: [10, 52, 1, 0]        
        }]

http://api.highcharts.com/highcharts#xAxis.categories