Zacknafein
Posts: 1
Joined: Wed Mar 29, 2023 9:38 am

X-axis to be all days of the years without a specific year

Hi,

I'm doing some graphics to show the difference on temperature, humidity and stuff over the years, and I don't want a continued line, but instead having different line going from the same "1st of jan to 31 of december", so you can see the difference from year to year..

Right now, the only way that I managed to do it is by "cheating" and giving every set of data the same year for the X axis.

In the best case, I want to make the x axis to be every days of the years, and only have to input the temperature data, like this example : https://jsfiddle.net/BlackLabel/r7t1jqpL/

Is there a simple way to do it, or do I have to manually write the 365 days of the years in the categories like it's done for the months in the example? I was hoping that something simple could be done to do it.
jakub.j
Posts: 1091
Joined: Tue Jan 24, 2023 11:14 am

Re: X-axis to be all days of the years without a specific year

Welcome to our forum and thanks for contacting us with your question!

You can achieve what you wanted by setting a pointStart property and pointIntervalUnit to 'day' on the series, along with xAxis.minRange so that when you insert the data, it will automatically add the days so you don't need to do it manually.

Demo: https://jsfiddle.net/BlackLabel/mwgp0ta6/

Let me know if that was what you were looking for!
Best regards
Jakub

Return to “Highcharts Usage”