Add the ability to add different colors in different segments to a single specific series
See original GitHub issueWhat problem does this feature solve?
There is no way to give multiple colors to a single series, The expected behavior is something similar to VisualMap, but for a single series instead of the whole chart.
What does the proposed API look like?
Add an object inside the series options to add a visualMap option on it something like
{
visualMap: {
...
}
}
Or some other way to provide the same functionality such as adding colors per series data points.
We can achieve the same functionality by splitting a single series into multiple series per colored segments, and adding a lineStyle
per segment, but unfortunately this leads to a really laggy chart as it significantly increases the number of series.
Output example
We would like to generate a performant version of a graph like this, where a single line can have multiple colors per segments.
This is generated by splitting a single line series into multiple line series, each with a different lineStyle
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Thanks for the explain. Perhaps you can try using the custom series to render these line segments.
But you need to process your data a bit to give the start and end point for each segment.
Custom series can display thousands of data in realtime. But for more data, like more than ten thousands. It may turn on progressive rendering automatically to avoid long rendering time freeze the page.
Here is an example rendering 65k line segments in the custom series with progressive rendering. https://echarts.apache.org/examples/en/editor.html?c=custom-wind