__seb
Posts: 5
Joined: Mon Oct 26, 2020 12:36 pm

Highstock rangeSelector selected not working

Hey,

I'm working on an Angular project with the official highcharts-angular wrapper.
My problem is, when I try to set the selected proeprty of rangeSelector the graph will not display but clicking on the buttons work.

Demo:
https://stackblitz.com/edit/highcharts- ... mponent.ts

Are my settings or anything else wrong?
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Highstock rangeSelector selected not working

Hi,
Thanks for contacting us with your question!

There is something with the way how you setData() or updateChart() when I put data in series the chart works.
I need more time to analyze this case.

Live demo:
https://stackblitz.com/edit/highcharts- ... service.ts

Let me know what do you think about this.
Best regards.
Sebastian Hajdus
Highcharts Developer
__seb
Posts: 5
Joined: Mon Oct 26, 2020 12:36 pm

Re: Highstock rangeSelector selected not working

Thank you very much for the respond.

I don't know if I understood what you meant :D, but I depend on getting the data from a server and being able to change the data later.

I just saw that besides "Optimal way to update" ther is also "Data from a service" as examples (https://github.com/highcharts/highchart ... e-examples). Should it work if i combine the two, though i Still don't know how to seperate my "spline" and "volume" data like:

Code: Select all

series: [
      {
        type: "spline",
        name: "Price",
        data: getSpline() // this
      },
      {
        type: "column",
        yAxis: 1,
        name: "Sold units",
        data: getVolume() // and this
      }
    ]
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Highstock rangeSelector selected not working

Hi :)
There should be no problem combining the two examples.

Try to simplify the way that you subscribe data and update it in the main ts file.
Here is the thread where subscribe loaded two separate series. And the graph is loaded by the ngOninit hook angular.

https://stackoverflow.com/questions/588 ... iple-lines
https://stackblitz.com/edit/angular-huyilk-e6z282

Let me know if it helps you.
Best regards.
Sebastian Hajdus
Highcharts Developer
__seb
Posts: 5
Joined: Mon Oct 26, 2020 12:36 pm

Re: Highstock rangeSelector selected not working

Thanks problem is solved!
Was actually not that hard :D
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Highstock rangeSelector selected not working

That's great to hear! :)
In case of any further questions, feel free to contact us again.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Stock”