google-visualization - pieSliceText 在谷歌图表中的位置
问题描述
我想在谷歌饼图中显示百分比文本,在圆边缘的饼图之外。我怎么做 ?
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn("string", "Topping");
data.addColumn("number", "Slices");
data.addRows([
["Mushrooms", 3],
["Onions", 1],
["Olives", 1],
["Zucchini", 1],
["Pepperoni", 2]
]);
// Set chart options
var options = {
title: "How Much Pizza I Ate Last Night",
width: 400,
height: 300,
pieHole: 0.4,
pieSliceTextStyle: { color: "black", fontSize: 10 }
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(
document.getElementById("chart_div")
);
chart.draw(data, options);
}
如果做不到。有没有更好的工具来创建饼图?
解决方案
推荐阅读
- karate - 执行脚本时,它将在模拟器中启动 URL,其余行不在空手道框架中执行
- python - 来自任何产品的客户评论的客户痛点的python wordcloud
- scala - Scala语义平等
- java - Java HTTP 池自定义标头
- javascript - 如何根据您来自哪个网页从一个网页访问另一个网页时为按钮添加过渡背景?
- android - onNewIntent 永远不会被调用 - Android
- c - PC-Lint 如何处理中断?
- python - 如何在每分钟一天内生成时间序列?
- python - 为什么 LSTM 模型不能正确预测值
- handlebars.js - 获取所有标签以制作导航组件,Ghost