We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
pChart 不直接支持这一点,我上次检查过。
但是,您可以使用 CSS 和重叠元素来做到这一点!您可以在一个网站上看到此示例:http://craftcult.com/heartchart .php?userid=sugarpinkboutique(按顶部图表上的“获取图表”按钮查看示例,首先选择“卖家买家分开”查看更详细的示例)。
本质上,您可以使用 JavaScript 和/或 CSS/HTML 在图表上覆盖可点击元素。我建议在 CSS 中使用绝对定位,并根据用于创建图表的数据使用 JS 创建元素。
我确实喜欢使用 pChart。它写得很好而且很灵活。我还在这里看到了这个链接,与在 JS 中执行类似操作的库相关:http://pchart。 sunyday.net/ImageMap/
pChart does not support this directly, last I checked.
However, you can do it with CSS and overlaid elements! One site where you can see an example of this in action is http://craftcult.com/heartchart.php?userid=sugarpinkboutique (press the Get Chart button on the top chart for an example, choose 'seller buyers separate' first for a more elaborate example).
Essentially, you can overlay clickable elements over the chart using JavaScript and/or CSS/HTML. I suggest using absolute positioning in your CSS, and creating the elements with JS based on the data used to create the chart.
I do enjoy working with pChart. It's pretty well-written and flexible. I also saw this link here on SO relating to a library for doing something similar in JS : http://pchart.sunyday.net/ImageMap/