User avatar
Kruppe
Posts: 12
Joined: Thu Feb 25, 2021 8:25 pm

multi series missing data point & issue w. xlabel

trying to apply multi serises with highstock:
https://jsfiddle.net/Kruppe/4hdcLevs/1/

but missing the last datapoint, e.g.

Code: Select all

{ 
        "data": [ // Thu Jan 14 2021 14:40:00 GMT+0000
            [1610635200000, 1090]
        ],
        "name": "Flow Out",
        "color": "Blue",
        "pointWidth": 10.8
 }
why?
on the other side, why only xlabels only show year %Y?
Further more, would it be possible to implement grouping for multi series?

thanks in advance for any advice.
/BR
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: multi series missing data point & issue w. xlabel

Hello, thanks for contacting us with your question!
I didn't really find the reason, why the last datapoint was invisible, even though, when i changed the type of chart to scatter, it appeared on the chart. But i don't really understand the reason, to create seperate series for each point. Since your series' name is either 'flow in' or 'flow out' i came to the assumption, that you only need 2 series. Check the following demo, where i changed your configuration to use only 2 series, and where are point appear, where you need them to: https://jsfiddle.net/BlackLabel/7rmfte60/


Regarding the second question, our lables on xAxis show the interval, that is suitable for the range of the axis. You can change the default labels formatting by defining the xAxis.format property or xAxis.formatter function. The api is right here: https://api.highcharts.com/highcharts/x ... .formatter

and here are available values for defining the periods of time for the labels: https://api.highcharts.com/highcharts/x ... belFormats

regarding the last question, i think that in the demo i shared, the grouping is already implemented. Let me know if that works for you, and in case of any further questions feel free to contact us again! Kind regards,
Paweł Lysy
Highcharts Developer
User avatar
Kruppe
Posts: 12
Joined: Thu Feb 25, 2021 8:25 pm

Re: multi series missing data point & issue w. xlabel

Thanks @pawelys for taking time to investigate and giving your suggestions.

But the data series has its purposes to design as multi series, not consolidated to 2 series ( although that's compromised solution), hereby each serie has its own pointWidth, with besides its height another intuitive illustrations to compare different data. Not alone to mention each series(column) would come from different device/source, i.e. should not be combined.

In general, I have a feeling mult-series for highchart is a bit challenging ( pls. see my my first post: viewtopic.php?t=46045)

I was even thinking about to 3D chart to get more data to be illustrated, but I still believe 2D highcharts/highstock could make it.

2nd quesiton, w.r.t. formatter, it involves javascript? for e.g. Django/Python to formulate JSON, It seems difficult to parse javascript to JSON and pass to webpage template.

3rd question, I still hope the xAxis in datatime can be scattered into e.g. multiple months, not just in 2 years' ticker. If that can be achieved, then, I would wish the data can be grouped in months.

Regards
User avatar
Kruppe
Posts: 12
Joined: Thu Feb 25, 2021 8:25 pm

Re: multi series missing data point & issue w. xlabel

PS: I have tried;

Code: Select all

            "xAxis": {
                "type": "datetime",
                'labels':{
                	'enabled': true,
                  'format': '{value: %Y-%m-%d}'
                },
                max: 1614746200000
            }, 
            
still not show up the last data point and only 2 years' ticker.
pawelys
Posts: 962
Joined: Wed Sep 02, 2020 10:37 am

Re: multi series missing data point & issue w. xlabel

1. Regarding the need of defining each points' width, you can still do it by defining its parameters this way: https://jsfiddle.net/BlackLabel/0e9uLma8/

If you are getting the data values from different sources, you can just add the points to the corresponding series, using series.addPoint( pointObject)

2. The formatter function is a js funciton, but you can use format attribute to define the way, that the you shared above.
3. I don't really understand what you mean by 2 years' ticker?

I am looking foreward to your reply! Kind regards,
Paweł Lysy
Highcharts Developer

Return to “Highcharts Stock”