apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.19k stars 19.61k forks source link

Custom functions on Echarts transform #19155

Open Covarians opened 11 months ago

Covarians commented 11 months ago

What problem does this feature solve?

We would like to add line chart that are calculated from the values of other lines charts in the same graph. The calculation formula would be a javascript line of code entered by the user. We believe that the 'transform' function is ideal for that but the documentation only describes the inbuild (sort, filter) functions or the ecstats ones.

What does the proposed API look like?

So we could have a 'custom' type where we can define a custom javascript function that can use some data stored in the 'dataset' using their names.

MatthiasMert commented 11 months ago

Heres an example that may help

Covarians commented 11 months ago

Hello, Thanks for the link, but it does not really help because the echarts-simple-transform does not give much explainations on how to build such addon, and the Echart documentation does not either. Regards.

noxidsoft commented 11 months ago

Heres an example that may help

The example isn't working, likely missing data?

buhbuhtig commented 6 months ago

I have a similar task. I want to multiply the input dataset by a constant using transformations. As I understand, there is no built-in map transformation (only sort and filter). Therefore, I would like simple examples of how to do it myself. Upd: I found a useful example: https://stackoverflow.com/questions/77847037/apache-echarts-linear-transformation-of-dataset