Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts data off by one day

I have a Highchart that I cannot seem to fix. The dates on the xAxis are correct but the dates on the labels are off by one day. No matter what data I pass to my chart it is always off by one day. I have been pulling my hair out trying to figure this out. Any tips would be appreciated.

You can see my code here: http://jsfiddle.net/brenjt/zxBTG/2/

like image 912
brenjt Avatar asked Apr 27 '12 15:04

brenjt


People also ask

How do I show no data available in Highcharts?

To show 'no data' message on a pie chart, you need to remove data from a chart. Also, the 'no data' feature requires the file no-data-to-display. js to be loaded in the page. If you want to show some kind of info when data is hidden, you can add custom text with Chart.

Is Highcharts stock free?

You can download and try out all Highcharts products for free. Once your project/product is ready for launch, purchase a commercial license.

How many data points can Highcharts handle?

Re: High Charts Data LimitBy default it is set to 1000, you should increase this value in your chart. If you are having problems with your chart it is good habit to open the console (Developer Tools) and look for errors.

How do I destroy Highcharts?

destroy () - Removes the chart and purges memory. This method should be called before writing a new chart into the same container. It is called internally on window unload to prevent leaks. var hc_options = { chart: { renderTo: 'container' }, series: [{ name: 'USD to EUR', data: usdeur }] }; var chart=new Highcharts.


2 Answers

Just found your question... I think the solution to your problem is to set up the UTC timezone option to false. This will set up the chart timezone to be local and not UTC.

Highcharts.setOptions({
    global : {
        useUTC : false
    }
});

See: http://api.highcharts.com/highcharts#global.useUTC

like image 113
Tony Avatar answered Oct 14 '22 08:10

Tony


Well, I added time info to the axis and tooltip see http://jsfiddle.net/gATfu/
It looks like your timestamps are from 10pm but the axis labels are showing 0am ... thats why the points look about one day shifted.

like image 42
dgw Avatar answered Oct 14 '22 07:10

dgw