首页 > 解决方案 > 我希望三个圆圈重叠。(使用高图表)

问题描述

我希望三个圆圈重叠。(使用highcharts)下面的选项不重叠我想知道如何

https://www.highcharts.com/demo/euler-diagram

在此处输入图像描述

Highcharts.chart('container', {
    accessibility: {
        point: {
            valueDescriptionFormat: '{point.name}: {point.longDescription}.'
        }
    },
    series: [{
        type: 'venn',
        data: [{
            sets: ['A'],
            value: 4,
            name: 'AAA',
            longDescription: 'desc1'
        }, {
            sets: ['B'],
            value: 1,
            name: 'BBB',
            longDescription: 'desc2'
        }, {
            sets: ['C'],
            value: 1,
            name: 'CCC',
            longDescription: 'desc2'
        }, {
            sets: ['A', 'B', 'C'],
            value: 1
        }]
    }],
    tooltip: {
        headerFormat:
            '<span style="color:{point.color}">\u2022</span> ' +
            '<span style="font-size: 14px"> {point.point.name}</span><br/>',
        pointFormat: '{point.longDescription}<br><span style="font-size: 10px">Source: Wikipedia</span>'
    },
    title: {
        text: 'Relationship between Euler and Venn diagrams'
    }
});

标签: javascripthighcharts

解决方案


用这个替换系列。您必须为 A 和 B、B 和 C 创建 2 组关系。重要提示:它们的值是不同的,因为相同的值会使它们重叠在一起。

series: [{
type: 'venn',
data: [{
  sets: ['A'],
  value: 4,
  name: 'Euler diagrams',
  longDescription: 'An Euler diagram is a diagrammatic means of representing sets and their ' +
    'relationships. Unlike Venn diagrams, which show all possible relations ' +
    'between different sets, the Euler diagram shows only relevant ' +
    'relationships.'
}, {
  sets: ['B'],
  value: 2,
  name: 'Venn diagrams',
  longDescription: 'In Venn diagrams the curves are overlapped in every possible way, ' +
    'showing all possible relations between the sets. They are thus a ' +
    'special case of Euler diagrams, which do not necessarily show all ' +
    'relations'
}, {
  sets: ['C'],
  value: 1,
  name: 'Hi diagrams',
  longDescription: 'In Venn diagrams the curves are overlapped in every possible way, ' +
    'showing all possible relations between the sets. They are thus a ' +
    'special case of Euler diagrams, which do not necessarily show all ' +
    'relations'
},{
  sets: ['A','B'],
  value: 2
},{
  sets: ['B','C'],
  value: 1
}
      ]
}]

推荐阅读