繁体   English   中英

HightCharts:如何将饼图位置与容器的右角或左角对齐

[英]HightCharts: How to align pie chart positions to right or left corner of the container

如何将 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: [..]

});

您可以为图表使用style属性。 请看附上的例子:

chart: {
    plotBackgroundColor: null,
    width: 200,
    height: 300,
    type: 'pie',
    style: {
        'float': 'right'
    }
},

现场演示: https : //jsfiddle.net/BlackLabel/2at3g47f/

API参考: https : //api.highcharts.com/highcharts/chart.style

暂无
暂无

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

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