Mark Henry
Mark Henry

Reputation: 2699

round number x-axis Jquery flot graph

I would like to round (0 decimals) the values on the x-axis of a flot graph. The x-axix show week numbers. Does anyone know how to do that?

http://www.snowcams.eu/snowcondition/saas%20fee/998

Upvotes: 3

Views: 6037

Answers (1)

jitter
jitter

Reputation: 54605

Here is your solution (this can all be found in the plugin API Documentation)

$.plot(
    $("#placeholder"),
    [{data:d1, lines:{show: true}, points:{show: true}, label:"Mountain"}],
    {xaxis: {tickSize:1, tickDecimals:0 }}
);

Upvotes: 13

Related Questions