Gvs Akhil
Gvs Akhil

Reputation: 2581

Make only one legend active in HighCharts at the start

I got success in getting the data from JSON File in HighCharts. But the only problem is I need only one legend to be active at the start...Any help will be Appreciated....

For getting Data
 for(let i=0;i<datae.dataa.length;i++)
              {
                chart.series[i].setName(datae.dataa[i].name);
                chart.series[i].setData(datae.dataa[i].data);        
              }

Present Output: enter image description here Required Output: Only one legend to be highlighted at start I am not good at HighCharts so please help me...

Upvotes: 0

Views: 243

Answers (1)

Maxim Egorushkin
Maxim Egorushkin

Reputation: 136208

Call Series.setVisible. E.g. chart.series[i].setVisible(false).

Or use visible member of series data when creating a chart.

Upvotes: 1

Related Questions