Open popup on click of points in jchartfx

234 Views Asked by At

I want to open the popup on click of points in jchartfx to display the detail information about that point. How can i pass the unique id to display the detail information dynamically?

1

There are 1 best solutions below

0
On

I'm not sure about performing it on click, but the jChartFX samples include a downloadable example (with some code) of doing this via tooltips (i.e. on hover).

Basically, you need to handle the 'gettip' event:

chart1.on("gettip", onGetTip);

The handler should create a div with the content for your tooltip:

function onGetTip(args) {
    divInTooltip = document.getElementById('tipChartInfo');
    args.tooltipDiv.appendChild(divInTooltip);
    args.replaceDiv = true;
    var dataPoint = args.getPoint();

    // Custom code based on the data point...
    ...
}

Regarding your specific question, the data point that the tooltip relates to is available via args.getPoint() .