LNDmouse
Posts: 21
Joined: Wed Jan 18, 2023 5:14 pm

Shows time insteat of year when dataGrouping disabled

When dataGrouping is disabled, and you press button "All" to show all data, label on X axis does't show year. Please advice how is it possible to show date, month and year simultaneously?

https://jsfiddle.net/LNDmouse/53rtj48q/6/
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Shows time insteat of year when dataGrouping disabled

Hello,
press button "All" to show all data, label on X axis does't show year
In the demo you sent, I don't see such a problem, only the formatting of the label changes from days and months to years.
is it possible to show date, month and year simultaneously?
What do you mean? Do you want the format of the label to not change?

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
LNDmouse
Posts: 21
Joined: Wed Jan 18, 2023 5:14 pm

Re: Shows time insteat of year when dataGrouping disabled

Michal, thank you for answer. Sorry my question in the first post wasn't precise.

I want to change label that is moving along x axis.

Now it shows for example "Tuesday, Jun 5, 02:00".

I want to change time "02:00" for year "yyyy", or just have dd-mm-yyyy format or similar.

Can you please advise how can I achieve it?
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Shows time insteat of year when dataGrouping disabled

Hi,

Okay, now I understand. To set this, use the xAxis.dateTimeLabelFormats property

Demo: https://jsfiddle.net/BlackLabel/4evdw1so/
API: https://api.highcharts.com/highcharts/x ... belFormats

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
LNDmouse
Posts: 21
Joined: Wed Jan 18, 2023 5:14 pm

Re: Shows time insteat of year when dataGrouping disabled

Michal, thank you for answer, but my problem is not with xAxis.dateTimeLabelFormat :)

What I want is to change format of text in the rectangular box that is moving along xAxis when you are pointing to the graph.

In the example that you sent me in the last post current format of text in that box is "Tuesday, Jun 5, 02:00", but I want to change time "02:00" for year "yyyy", or just have dd-mm-yyyy format or similar.

Can you please help me with it?
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Shows time insteat of year when dataGrouping disabled

Hi,

All tooltip settings can be found here: https://api.highcharts.com/highstock/tooltip
To set the date formatting of the bottom tooltip you can use tooltip.xDateFormat or tooltip.headerFormat if you want to set more custom formatting with an extra message.

Demo: https://jsfiddle.net/BlackLabel/xbpe4m3w/
API: https://api.highcharts.com/highstock/to ... DateFormat
https://api.highcharts.com/highstock/to ... aderFormat

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
LNDmouse
Posts: 21
Joined: Wed Jan 18, 2023 5:14 pm

Re: Shows time insteat of year when dataGrouping disabled

Thank you, that is what I wanted :)
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Shows time insteat of year when dataGrouping disabled

You're welcome! In case of any further questions, feel free to contact us again.

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Stock”