【发布时间】:2018-08-21 19:45:58
【问题描述】:
如何将 highcharts 中的饼图与容器中的右端或左端对齐?我注意到 center:[] 属性使用百分比工作,但在调整容器大小时会出现一些位置问题。请检查下面的小提琴链接。
Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Browser market shares in January, 2018'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
}
},
series: [..]
});
【问题讨论】:
-
尝试删除“容器”div 的“最大宽度”CSS 属性。
-
No Vinay 它不能使用 100% 宽度 :(
-
如下更改您的容器 html 代码。它至少在小提琴中起作用。
-
由于我的外部容器是可调整大小的,不能固定最小宽度
标签: javascript svg highcharts