More powerful data filter by legend / visualMap #11869
Labels
discussion-required
Further discussion is required before we decide if this issue should be fixed.
new-feature
stale
Inactive for a long time. Will be closed in 7 days.
topic: legend
topic: visualMap
Milestone
Consider these scenarios:
ScenarioA: series filter
In some monitoring systems, we offen see that there are so many line-series in one chart that the legend items are too many to be checked. That might be resolved some other data visualization design. But in lots of cases it is not practical. And the component "visualMap" can do this but it can only interfere the "visual" of graphic elements rather than "remove" some of them to re-layout or change the extent of the axes, which is necessary to dig into the data in some case.
So it will be good if "multiple legends" can take responsibility on filtering series or data.
For scenarioB, check this example for example: https://gallery.echartsjs.com/editor.html?c=xeSoAEHBI&v=1
But the usage in the example is too complicated, containing code on event listening and dummy series. It is necessary to simplify it.
The ideal solution for ScenarioA migth be:
ScenarioB: custom series data filter
Suppose we are making a bar or custom series, where each "dataItem" is mapped to a graphic element. If there are so many data items that users need to filter them with user interaction.
Consider this example: https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight
If we need to use legend to filter flights. Each legend item represents a criterion. Those criteria might not only be enumerable tags but probably also be some calculable condition like filter the flights earlier than 8:00.
The ideal solution for ScenarioB migth be:
ScenarioC: filter series data with legend or visualMap
Suppose we have this data:
And we need to make a scatter chart, "Female" are mapped to green circles and "Male" are mapped to red circles. And "Female" and "Male" should be able to filtered and trigger subsequent change of axis extent.
We can achieve it by make users to split data to two series:
But it requires a extra workload of data process. Moreover, if we need to make some another filters on country, it is not easy to implement.
Probably the better way is we still use the original data, and make "multiple legend components" enable to filter data. Or we can also make "multiple visualMap components" enable to filter data, that can set customized color visual meanwhile. To achieve this goal, we need to define the two mechanism:
(1) Retrieve the enumrable data values from the given dimension.
(2) Make a customizable
List::filterSlef
.Legend selector (All, Reverse) defect
Another relevant issues needed to be resolved:
should only control one legend component, but not all legend components.
Check the example: https://gallery.echartsjs.com/editor.html?c=xeSoAEHBI&v=1
The text was updated successfully, but these errors were encountered: