mayag
Posts: 23
Joined: Thu Dec 15, 2022 9:58 am

Highcharts stock implementation

Hi
I made a small POC that I want to implement in my project
https://jsfiddle.net/Maya_Greber/z3efktb1/249/
I have a problem that the date starts on the 26th and according to the data it should start on the 27th

In addition, when I implement it in my project I have some problems:
1. You can see in the attached picture, I received another unwanted DATA on the date that I don't know where it came from (00:00:00.020)
2. The scroll doesn't work for me, but I think it's because of the problem in point 1

Last question, how do I transfer a date in this format: 1636243200000
For this format: MM/DD/YYYY

Thanks, Maya.
mayag
Posts: 23
Joined: Thu Dec 15, 2022 9:58 am

Re: Highcharts stock implementation

for the last question, i understand how to do it :)
User avatar
dawid.d
Posts: 847
Joined: Thu Oct 06, 2022 11:31 am

Re: Highcharts stock implementation

Hello,

Thanks for contacting us with your question!

1) I don't know if I understand the problem. Everything seems to be working fine for me.

2) The scroll has been deliberately turned off so the page does not scroll unintentionally when zooming in on the chart with the mouse. It can be easily disabled by removing the event.preventDefault() function call like in the demo below.

Demo: https://jsfiddle.net/BlackLabel/4L1cjvha/

Let me know if that is what you were looking for!
Best regards
Dawid Draguła
Highcharts Developer
mayag
Posts: 23
Joined: Thu Dec 15, 2022 9:58 am

Re: Highcharts stock implementation

Hello,

Thank you for your response!

I'm trying to create a chart that shows a 3-month time span and is based on data by dates, where each date has several different data and each data is displayed in its own series.
For example, a table showing the weather data based on the date and each date has some data such as: degrees, amount of rain, wind speed, etc. Each of these is shown in its own series.

My problem is that when I want to implement the code I wrote here https://jsfiddle.net/Maya_Greber/z3efktb1/249/ in my project I get an empty string of a time point in the axes instead of dates.
And I think this is also the reason that the mouse scroll does not work properly for me.
As I mentioned above, in my project I present in the chart fixed dates from 1/1 - 1/4 when there is data that is in the specified date range they appear as series in the chart and axes show the correct dates, but all the dates that are not in series appear as an unclear date (22:00:00.000)

I created this to symbolize my problem https://jsfiddle.net/Maya_Greber/z3efktb1/254/
When I have only one figure in the table, an unclear date (22:00:00.000) is shown to me in the axes instead of the desired date. In addition, the date that appears to me in the tooltip is incorrect. (The displayed date is 12/26 and the desired date is 12/27)

I want to point out that I have a working component, my problem started when I tried to insert the mouse scroll option into the chart I created.

Thanks, Maya.
mayag
Posts: 23
Joined: Thu Dec 15, 2022 9:58 am

Re: Highcharts stock implementation

In the axes i marked in blue the unclear date date and in yellow line i get .Jan that i don't know where its coming from.

Screenshot_10.png
Screenshot_10.png (22.59 KiB) Viewed 576 times
Screenshot_11.png
Screenshot_11.png (29.89 KiB) Viewed 576 times
User avatar
dawid.d
Posts: 847
Joined: Thu Oct 06, 2022 11:31 am

Re: Highcharts stock implementation

Hi,

As for this one point, that's how it was defined in the demo you sent. If you want to set a strict x-axis label format, you need to do it in xAxis.labels.format, not xAxis.format as you did. The problem with displaying the wrong date is due to time zone differences. If you really want to parse a string, you can do it as in the demo below.

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

As for the problem you are presenting in the screenshots, unfortunately, I am not able to reproduce it.

I hope you will find it useful
Regards!
Dawid Draguła
Highcharts Developer

Return to “Highcharts Stock”