How can I use the x and y values of selected point of line chart for on click event?

0
I made a line chart with the month of sales on the x axis and the monthly amount of sales on the y axis. When I click on a point on the line chart, I would like to show the list of the sales data for the corresponding month. How can I retain the clicked data (x and y values) and use it in a page or microflow?
asked
1 answers
0

Hi Sumire,

When clicking on a point, you will obtain information in the following format:
 

[
    {
        "curveNumber": 1,
        "pointNumber": 10,
        "pointIndex": 10,
        "x": "2023-02-22 02:00",
        "y": 8989,
        "id": "6e3b8e97-26aa-430a-8790-7ddf3d50bb57"
    }
]


You should create a helper entity that can capture the above JSON structure in its raw format and then have an import mapping to convert it to an entity you can then re-use.

How you can utilize it, would differ from your implementation. For instance, if you only show the sales for a single company, you can use the x-value to determine the month and then show a page with that month’s sales.

The conversion of the JSON structure and opening of the page can all be combined in your on-click microflow.

​​​​​​​Hope it helps!

answered