简体   繁体   English

单击jchartfx中的点打开弹出窗口

[英]Open popup on click of points in jchartfx

I want to open the popup on click of points in jchartfx to display the detail information about that point. 我想在单击jchartfx中的点时打开弹出窗口,以显示有关该点的详细信息。 How can i pass the unique id to display the detail information dynamically? 如何传递唯一ID以动态显示详细信息?

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 (ie on hover). 我不确定在click上执行此操作 ,但是jChartFX示例包含一个可下载的示例 (带有一些代码 ),该示例通过工具提示 (即,悬停时)执行此操作。

Basically, you need to handle the 'gettip' event: 基本上,您需要处理'gettip'事件:

chart1.on("gettip", onGetTip);

The handler should create a div with the content for your tooltip: 处理程序应使用您的工具提示的内容创建一个div:

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() . 关于您的特定问题,可以通过args.getPoint()获得与工具提示相关的数据点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM