I am currently looking for a solution to dynamically create highcharts series in my project. Although I have tried using the addSeries method, I am encountering an issue where an extra legend is appearing unnecessarily. If you are aware of any alternative methods that could help me resolve this problem, please share them with me. I have only provided a snippet of my chart code here without including the total code. Here, I am simply adding my series to the chart.
$(function () {
chart = Highcharts.chart('container', {
series: [
{
}
]
});
});
json:
"dataa":
[
{
"name": "Unit Test 1",
"data":[1,13,15,17,40,50,80]
},
{
"name": "Unit Test 2",
"data":[2,20,50,40,20,50,15]
},
{
"name": "Unit Test 3",
"data":[3,50,40,10,30,40,25]
}
]
ajax:
let dataeDatal=datae.dataa.length;
for (let i = 0; i < dataeDatal; i++) {
chart.addSeries({
data: datae.dataa[i].data,
name: datae.dataa[i].name
});
}
}
https://i.sstatic.net/SvnFz.png
In the attached image, you can see that there is an additional 'series1' legend being displayed, which needs to be resolved.