http://github.com/krzysu/flot.tooltipを使用しています。以下のようにデータのパーセンテージを示します。しかし、パーセンテージではなく実際の値を表示する必要があります。これどうやってするの ?
Jsonデータ
[{"data":350、 "label": "Transport"}、{"data":250、 "label": "Meals"}、{"data":250、 "label": "Kitchen"}、{ "data":7280.5、 "label": "Construction"}、{"data":3725、 "label": "Fuel"}、{"data":160、 "label": "Stationary"}]
脚本
function make_chart() {
$.ajax({
cache : 'false',
type : 'GET',
dataType : 'json',
url : "piechart",
success : function(json) {
var plotObj = $.plot($("#flot-pie-chart"), json, {
series: {
pie: {
show: true
}
},
grid: {
hoverable: true
},
tooltip: true,
tooltipOpts: {
content: "%p.0%, %s", // show percentages, rounding to 2 decimal places
shifts: {
x: 20,
y: 0
},
defaultTheme: false
}
});
}
});
}
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加