| [Chart:Pie]???????2014-03-07 16:36:38by ???
// 替换颜色为渐进色
$A.Charts.getOptions().colors = Aurora.Charts.map(Aurora.Charts.getOptions().colors, function(color) {
return {
radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
stops: [
[0, color],
[1, Aurora.Charts.Color(color).brighten(0.4).get('rgb')]
]
};
});
function formatter1(){
return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
}
<a:dataSets>
<a:dataSet id="ds">
<a:datas>
<a:record browser="Firefox" shares="45"/>
<a:record browser="IE" shares="26.8"/>
<a:record browser="Chrome" shares="12.8"/>
<a:record browser="Safari" shares="8.5"/>
<a:record browser="Opera" shares="6.2"/>
<a:record browser="Others" shares="0.7"/>
</a:datas>
<a:fields>
<a:field name="browser" prompt="浏览器"/>
<a:field name="shares" datatype="float" prompt="份额"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:chart bindTarget="ds" type="pie" plotBackgroundColor="null" plotBorderWidth="null" plotShadow="false" >
<a:title text="2010年特定网站下浏览器的市场份额"/>
<a:tooltip pointFormat="{series.name}: <b>{point.percentage:.1f}%</b>"/>
<a:plotOptions>
<a:pie allowPointSelect="true" cursor="pointer">
<a:dataLabels enabled="true" color="#000" connectorColor="#000" formatter="formatter1" />
</a:pie>
</a:plotOptions>
<a:xAxis>
<a:xAxi name="browser" />
</a:xAxis>
<a:yAxis>
<a:yAxi name="shares" />
</a:yAxis>
<a:seriesList>
<a:seriesItem name="shares">
<a:seriesDatas>
<a:seriesData dataIndex="2" sliced="true" selected="true"/>
</a:seriesDatas>
</a:seriesItem>
</a:seriesList>
</a:chart>
Demo Attachments |

Comments
0 Responses to the article暂时没有评论。