简体   繁体   中英

Google Visualization Pie Chart text anchor issue and text cut off

I am using google pie charts, all is working fine but legend label on right side is cut off. 在此处输入图片说明

there is also no option in google API to control these labels. here is documentations https://developers.google.com/chart/interactive/docs/gallery/piechart#configuration-options

for whiteHat please see here are images.. 1st 隐藏div with hide div

and a div not hide...

无隐藏div

the legend would normally wrap, see following working snippet,
using the options shown in the attached image

 google.charts.load('current', { callback: function () { var container = document.getElementById('chart_div'); var chart = new google.visualization.PieChart(container); var data = google.visualization.arrayToDataTable([ ['Education', 'People'], ['less than high school', 10], ['high school', 10], ['college associate', 10], ]); var options = { width: '470', height: '450', chartArea: { width: '80%', height: '80%', left: 100, }, pieSliceTextStyle: { color: 'white', fontSize: '17.5' }, colors: ['#90c458', '#ff7f66', '#ffce55', '#52c2e8'] }; chart.draw(data, options); }, packages: ['corechart'] }); 
 <script src="https://www.gstatic.com/charts/loader.js"></script> <div id="chart_div"></div> 

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