Covarians commented on issue #19024:
URL: https://github.com/apache/echarts/issues/19024#issuecomment-1688048217
Hello,
Thanks for your answer. I undesrtood the sample code but our case is a litte
bit different so let me explain better.
If we want to add a new serie to a graph we need first to create the Yaxis
then to create the Series and reference the series to the YAxisIndex parameters.
Using the setOption with replaceMerge option the code would be the following:
```
option = {
yAxis : []
series : []
}
// Add new Y axis
option.yAxis.push({
id: newSerieId,
position: "left",
type: "value",
gridIndex: gridIndex,
triggerEvent: true
});
// Add new series.
option.series.push({
id: newSerieId,
encode: {
x: "datetimes",
y: serie.name
},
seriesLayoutBy: "row",
name: serie.name,
xAxisIndex: gridIndex,
yAxisIndex: HOW DO I GUESS THE INDEX ?
// ...
});
chart.setOption(option, { replaceMerge: replace_merge_elements });
```
So you see here the problem we are facing : We need to know before its
creation the Yaxis index at which the YAxis will be positionned by Echarts.
And we do not know how Echart will decide it.
So it would be much simpler to define yAxisId instead of yAxisIndex in the
option object !
This would also improve the architecture of Echart : Ids on the application
side, Indexes hidden in the realm of Echarts code.
Thanks for your help.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]