0

I have a graph which portrays data 802.000 years back in time. However, I don't succeed in making Highcharts understand the datetime setting... I tried it with different year formatting, such as "-800000" or "Date.UTC(-800000,01,01)", but in vain.

The xaxis doesn't show the correct years... enter image description here

The xaxis setting is just

type:"datetime"

The data look like this:

Date.UTC(1975,01,01),,329.4,,331.08,3.336.116.667,,,,,

Here is a fiddle.

Thanks for any hints.

luftikus143
  • 1,285
  • 3
  • 27
  • 52

1 Answers1

1

Please check this thread about minimum and maximum date: Minimum and maximum date

Because that is a general date issue, I recommend you to use a category axis type:

xAxis: {
    type: "category",
}

Live demo: https://jsfiddle.net/BlackLabel/vwnuqmch/

API Reference: https://api.highcharts.com/highcharts/xAxis.type

ppotaczek
  • 36,341
  • 2
  • 14
  • 24
  • Ah, thanks. Didn't know the thing with the minimum @ "01 January, 1970 UTC". However, with »category« the distance between the data points, which are not equal, they are always rendered the same. With »datetime«, it respects the differences. Played a bit around, and seems to work now, with no »type« defined and a Javascript function to convert to DecimalDate used. [Here is the fiddle](https://jsfiddle.net/luftikus143/cnoqgexh/10/). – luftikus143 Nov 25 '19 at 11:13
  • Hi @luftikus143, The default type is `linear`, so yes - that is also a good solution. – ppotaczek Nov 25 '19 at 11:23