简体   繁体   中英

display high chart pie chart on the top of the div

i have the high-chart with label as shown below在此处输入图片说明

how to display the chart from the top left corner

i have tried doing it as below

{
                legend: {
                    itemStyle: {
                        fontSize:'8px'
                     },
                     align: 'right',
                     layout: 'vertical',
                     verticalAlign: 'top',
                     x: this.state.legendXValue ? this.state.legendXValue  : 10,
                     y: this.state.legendYValue ? this.state.legendYValue  : 30,
                    backgroundColor: 'rgba(255,255,255,0.2)'
                }

            }

but chart is not aligning to the top left

please let know how to configure chart parts to render it from the top left i mean there is lot of space in the top left how to remove it and utilize it for the chart

You can position the pie chart according to your requirements by using center property:

series: [{
  center: ['30%', '40%'],
  size: '80%',
  ...
}]

Live demo: http://jsfiddle.net/BlackLabel/6m4e8x0y/4812/

API Reference:

https://api.highcharts.com/highcharts/series.pie.center

https://api.highcharts.com/highcharts/series.pie.size

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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