Matt Fenwick
Matt Fenwick

Reputation: 49105

How do I create a correctly scaled x-axis?

I'm using HighCharts line plots where my x-axis data is unevenly distributed:

[4, 10, 40, 100, 400, 1000, etc.]

Currently the x-values are placed evenly. I want the distance between x[5] and x[4] to be 10 times that between x[3] and x2. How do I do this?


In the GoogleCharts lingo, I need a continuous axis.


In the docs, I only see "linear", "logarithmic", and "datetime" for the axis type. ("linear" is the default and does not do what I want).

Upvotes: 5

Views: 3317

Answers (1)

dgw
dgw

Reputation: 13666

Since you didn't post your javascript generating the charts I'll have to guess, but I assume you are using categories within your xAxis. The categories are evenly distributed, so don't use them in this case.

If you change your series data block to specify x and y values (http://www.highcharts.com/ref/#series--data example 2) the xAxis will show correct proportions for your values. For example look at this fiddle.

Upvotes: 5

Related Questions