php - Highcharts graph X-axis label for different date ranges -
i have written below code generates area graph selected dates (to , dates).
$(document).ready(function() { var options = { "series": [{ "showinlegend": false, "color": "#d0d0d0", "name": "revenue", "data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}], "credits": { "enabled": false }, "chart": { "renderto": "highchart_id", "defaultseriestype": "area", "shadow": true }, "title": { "text": null, "align": "center", "x": 0, "y": 20 }, "xaxis": { "type": "datetime", "datetimelabelformats": { "month": "%e. %b", "year": "%b" }, "labels": { "enabled": "false" } }, "legend": { "enabled": true }, "yaxis": { "title": { "text": "" }, "labels": { "enabled": true } }, "plotoptions": { "area": { "stacking": "normal", "linecolor": "#3e3e3e", "linewidth": 3, "marker": { "linewidth": "1", "linecolor": "#3e3e3e", "states": { "hover": { "enabled": true, "radius": 1 } } } }, "series": { "pointstart": 1335823200000, "pointinterval": 86400000 } } }; var chart = new highcharts.chart(options); });
the interval of dates on x-axis coming 1 day less. here series value 2 10 may whereas showing 9 may in graph.
i new highchart, can advice solution please , let me known if need more clarification on problem.
try adding code before declaring chart
highcharts.setoptions({ global: { useutc: false } });
by default highchart used utc times. adding code above use time zone of browser.
Comments
Post a Comment