Kyvis-Labs / ignition-apexcharts-module

The module provides Perspective ApexCharts components
Apache License 2.0
59 stars 11 forks source link

Custom icon and xAxisLabelClick event on Apex chart #52

Open dhananjayvichare opened 7 months ago

dhananjayvichare commented 7 months ago

I would like to add custom icon on Apex chart toolbar, I have added referring below documentation. However, the event is not exposed on Ignition perspective.

image

also wanted to add X axis label click I have added "xAxisLabelClick" option in events, however not able to find event on the Ignition perspective.

traviscox commented 5 months ago

You can definitely do the custom icon, here is an example of the options config:

{ "chart": { "height": 350, "stacked": false, "toolbar": { "show": true, "tools": { "customIcons": [ { "class": "custom-icon", "click": "function (chart, options, e) { console.log(\"clicked custom-icon\") }", "icon": "\u003cimg src\u003d\u0027/system/images/Builtin/icons/16/wrench.png\u0027 width\u003d\u002720\u0027\u003e", "index": 4, "title": "tooltip of the icon" } ] } }, "type": "line" }, "dataLabels": { "enabled": false }, "fill": { "opacity": 1 }, "markers": { "size": 0 }, "stroke": { "width": 3 }, "xaxis": { "type": "datetime" }, "yaxis": { "labels": { "formatter": "function (val) { return val.toFixed(2); }" } } }

For the xAxisLabelClick that was added in in 1.0.17:

https://github.com/Kyvis-Labs/ignition-apexcharts-module/releases/tag/1.0.17