1

I want the x axis of a HighChart to represent the Real Line.

Suppose I am modelling the constant function f(x) = 2 on the domain -3 <= x <= 3, where x is an integer.

I can do this by using the following chart as a series in HighCharts - [ 2, 2, 2, 2, 2, 2, 2 ]

However the x axis shows up in HighCharts as 1, 2, 3, 4, 5, 6, 7 - which makes sense as I never set any stipulations on the x axis!

So I then set the min and max of the axis to -3 and +3 respectively, thinking this would shift the function onto the correct domain.

The x axis now shows up as -3, -2, -1, 0, 1, 2, 3 - however the function still gets plotted over x = 1 to x = 7.

So how do I get the data to plot over the desired domain - -3 <= x <= 3?

0

1 Answer 1

1

You can use pointStart to define x starting point:

    plotOptions: {
        series: {
            pointStart: -3
        }
    },

See example at jsfiddle

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.