I have an array of points and want to set the array as the source of series like text. How can I set series via javascript code dynamically?
My code is:
series: this.graph?.data.map(data => {
return {
name: data.label,
showSymbol: data.showIcon,
type: 'line',
lineStyle: {
width: data.lineTickness ? data.lineTickness : data.isThreshold ? 6 : 1,
cap: 'round',
color: data.lineColor ? data.lineColor : null,
type: data.lineType ? data.lineType.toLowerCase() : null,
},
itemStyle: {
normal: {
color: data.lineColor ? data.lineColor : null,
}
},
step: data.step,
data: data.points.map(point => {return point.value?.numeric?.toFixed(4)}),
areaStyle: data.area ? {} : null,
yAxisIndex: data.associatedY2Axis ? 1 : 0,
zlevel: data.isThreshold ? 0 : 1
}
})
But doesn’t work properl and will miss some data on the exported chart.