0
Fusion Chartsスクリプトでは、グラフラベルをパーセントで簡単に表示できます。しかし、ラベルに値を表示し、ドーナツチャートの中央にパーセンテージを表示する必要があります。Fusion Chartsは、ドーナツチャートのcenterLabelとしてパーセントを表示します
Fusion Charts APIはこのオプションをカバーしていません。利用可能な変数は$ valueと$ labelだけです。
これは可能ですか?私は何かを明らかに欠けているように見える場合はここで
は、セットアップのためのいくつかのjQueryのです:
$.each(jsonDataPoints, function (index, obj) {
var hoverText = obj.label + " (" + obj.value + ")";
//obj.toolText = hoverText; //This sets the text to display when a pie chart is hovered.
//obj.displayValue = hoverText; //This sets the chart labels.
obj.displayValue = obj.value; //This sets the chart labels.
obj.centerLabel = obj.percentValue;//percentValue is not an object. Just a guess
});
var doughnutChart = new FusionCharts({
type: 'doughnut2D',
renderAt: containerId,
registerWithJS: '1',
dataFormat: 'json',
"width": "100%",
"height": "100%",
dataSource: {
"chart": {
"paletteColors": "#0075c2,#1aaf5d,#f2c500,#f45b00,#8e0000",
"bgColor": "#ffffff",
"showBorder": "0",
"use3DLighting": "0",
"showShadow": "0",
"enableSmartLabels": "0",
"startingAngle": "310",
"showLabels": "0",
"showPercentValues": "1",
"showLegend": "1",
"legendShadow": "0",
"legendBorderAlpha": "0",
"defaultCenterLabel": "...",
"centerLabel": "$value",
"centerLabelBold": "1",
"showTooltip": "1",
"decimals": "0",
"captionFontSize": "14",
"subcaptionFontSize": "14",
"subcaptionFontBold": "0",
"useDataPlotColorForLabels": "1",
"labelDistance": "-20",
"baseFontSize": "13",
},
"data": jsonDataPoints
}
});
doughnutChart.render();