Highcharts:维恩图如何显示总数和联盟数字? [英] Highcharts : Venn Diagram how to show total and union numbers?

查看:260
本文介绍了Highcharts:维恩图如何显示总数和联盟数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 highchart.js 生成报告。我需要生成如下图所示的维恩图:



借助 这个post jsfiddle示例 ,我将能够生成维恩图,但没有得到如何显示圈内的数字。我阅读了关于如何在系列选项中传递数据的文档,如 here ,但无法理解。我们可以用highcharts做这样的事吗?请指点一些指针或演示示例,以帮助我实现上述示例。

我看过其他的维恩图生成的JavaScript,很好实施,但由于大多数报告使用highcharts.js我不想集成任何其他图js只是为了获得维恩图功能。

解决方案

好的,你可以尝试使用dataLabels,像这样: http://jsfiddle.net/AyqzZ/78/ ,但每个圆圈只能得到一个标签。



我认为唯一的解决方法是使用 renderer 向图表添加文本。但首先,您需要计算放置该标签的位置,这是最难的部分 - 为几个圈找到交叉点。之后,在这种方式中添加标签。 /api.highcharts.com/highcharts#chart.events.loadrel =nofollow>载入事件。


I am using highchart.js to generate reports. I need to generate venn diagram like the below image :

With the help of this post and jsfiddle example, I will be able to generate Venn Diagram but not getting how to show the numbers inside the circle. I read the doc on how to pass data in the series option as given here but not able to understand how. Can we do something like this using highcharts? Please point me to some pointers or demo examples that can help me achieve the above example.

I have looked at other venn diagram generating javascript that are good to implement but as most of the report uses highcharts.js i dont want to integrate any other graph js just to get the venn diagram functionality.

解决方案

Well, you can try to use dataLabels, like this: http://jsfiddle.net/AyqzZ/78/ but you will get only one label per circle.

I think the only solution is to use renderer to add texts to the chart. But first you need to calculate where put that label, and that's the hardest part - find intersection for a few circles. After that add labels this way in load event.

这篇关于Highcharts:维恩图如何显示总数和联盟数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆