matthewcy
Posts: 4
Joined: Fri Jul 16, 2021 5:37 pm

Load Different Data from Database on Different Days

Hi, I'm new to HighCharts but I saw this example chart using HighCharts here (https://lasp.colorado.edu/maven/sdc/pub ... kp/kp.html) which uses HighCharts and I'd like to do something similar. Basically, the graph can only show 48 hours at a time at most, and when selecting different days of the calendar, you load different data from your database to chart. I'd like to do something similar, where I'm also using timeseries data across multiple months, and even just for a couple of days there are more than a million data points. Could someone point me in the right direction? I have all my data in MySql already and want to either use php or nodejs + react for the rest of the project. Thank you!
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Load Different Data from Database on Different Days

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

I would see it as follows, you create a custom button in rangeSelector.buttons and show only for those specified ranges.
If you thinking about a data picker for chose day it will be more difficult to do, but probably not impossible.

API References:
https://api.highcharts.com/highstock/ra ... or.buttons

About loading data I don't have one answer, please have a look at these articles they explain how to manage data and how data is processed.
https://api.highcharts.com/highcharts/data
https://www.highcharts.com/docs/working ... data-intro
https://www.highcharts.com/blog/tutoria ... -data-api/

Let me know If you have more questions.
Best regards.
Sebastian Hajdus
Highcharts Developer
matthewcy
Posts: 4
Joined: Fri Jul 16, 2021 5:37 pm

Re: Load Different Data from Database on Different Days

Hi @sebastian.h, thank you for your response! Do you know if there's a way to get the current calendar month and day from the Stocks calendar button? Or if I could modify the calendar button as well? My idea is to store the month and day in some sort of state variable and make a new query for the data base on change of the state variable.
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Load Different Data from Database on Different Days

Hi,
This calendar it's HTML element <input type="date"> how they looks it depends on the browser that you use.
You can make any modifications by accessing the input type date.

Documentation:
https://developer.mozilla.org/en-US/doc ... input/date

Best regards.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Stock”