簡體   English   中英

Highcharts圓環圖定制

[英]Highcharts donut chart customization

我有一個highcharts的許可證,我想創建一個類似下面的字符:

在此輸入圖像描述

highcharts上最相似的組件如下:

在此輸入圖像描述

有人知道是否可以將PIE替換為百分之幾? 或者其他一些好的客戶端javascript庫可以做到嗎?

您可以在以下鏈接中找到演示和API。

DEMO http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/pie-donut/

API http://api.highcharts.com/highcharts#chart

謝謝

檢查innerSize

"The size of the inner diameter for the pie. A size greater than 0 renders a donut chart. Can be a percentage or pixel value. Percentages are relative to the size of the plot area. Pixel values are given as integers. Defaults to 0." 參考

你可以看看這個例子 ,它展示了如何將text放在圓環圖中。

希望它對你有所幫助。

您可以嘗試使用title作為替代和相當簡單的方法。

            title: {
                text: 'Budget',
                align: 'center',
                verticalAlign: 'middle',
                style: {
                    fontSize: '9.5px'
                } 
            },

JsFiddle: http//jsfiddle.net/amigoo/zwod86e1/

 function(chart4) {
chart4.renderer.text('<span style="word-wrap: break-word !important;">Reduced by <br/>10 Years</span>', (chart4.chartWidth/2)-38, (chart4.chartHeight/2)-5)
             .css({

                color: '#4b4b4b',
                fontWeight: 'bold',
                fontSize: '12px'

            })
            .add();
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM