【发布时间】:2015-07-23 08:51:16
【问题描述】:
如何更改饼图图例的文本。我在我的 php 页面中使用 c3 图表。我已经阅读了 c3 图表的文档,但没有运气。
目前我正在使用此代码显示true 的图例,但我无法更改我尝试过的文本。
var chart = c3.generate({
bindto: '#container',
padding: {
top: 10,
right: 0,
bottom: 10,
left: 0,
},
data: {
columns: [<?php echo $pieChartDataString; ?>],
type : 'pie',
labels: true
},
legend: {
show: true,
position: 'upper-center'
format: {
title: function () { return "Legend title"; },
name : function () { return "Legend name"; },
value: function () { return "Legend value";}
}
}
//But these legend values or not showing
});
它没有显示我的图例值,它总是只显示列作为图例。
有什么方法可以更改图例值。
【问题讨论】:
标签: javascript php charts c3.js