echarts icon indicating copy to clipboard operation
echarts copied to clipboard

Custom functions on Echarts transform

Open Covarians opened this issue 1 year ago • 4 comments

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.

Covarians avatar Sep 26 '23 06:09 Covarians

Heres an example that may help

MatthiasMert avatar Sep 27 '23 07:09 MatthiasMert

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.

Covarians avatar Sep 27 '23 08:09 Covarians

Heres an example that may help

The example isn't working, likely missing data?

noxidsoft avatar Oct 16 '23 05:10 noxidsoft

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

buhbuhtig avatar Feb 23 '24 11:02 buhbuhtig