What problem does this feature solve?
This feature solves the need to dynamically set the label position when using the dataset data source.
Here are two examples, one using the data array and the other using dataset. When using dataset, I can't customize the position of the label based on the data.
There was another issue that discussed a similar issue before.
What does the proposed API look like?
I can think of 3 different solutions so far
- add more label position enum value support for more situations
- add callback function support for
series.label.positon
- add new encode dimension for get label position value from dataset.
4条答案
按热度按时间f45qwnt81#
one solution is to add filter transformation datasets and attach separate series to them - Demo .
x33g5p2x2#
Thanks @helgasoft , this is indeed a good solution.
But for the case of dynamically generated chart options, this can create additional headaches.
For instance, in my project, I use the Web UI to dynamically configure which way to visualize the data,
the reason for using dataset is that it can provide a consistent data mapping scheme for almost any type of chart,
but
transformation
obviously destroys this advantage, this separated the unified data sources again.5gfr0r5j3#
ok, I understand, label position needs to be a data column in dataset.
Then you could pre-process the dataset and generate a data array, like in your (1.example).
w8f9ii694#
@helgasoft
Yes, this is one of the solutions I was looking forward to,
If it is possible to enhance
series-xxx.encode
so that other options can also get data through it, just like seriesName, tooltip, etc...Of course, it would also be great if all options could support callbacks, as mentioned in #15997 .