javascript - Amcharts Pie Chart show country only on hover -
in demo http://www.amcharts.com/demos/simple-pie-chart/#theme-light shows country , percent both @ first view , on hover. percent shown @ first view, , show country: percent on hover.
is possible? many help!
you can use chart property labeltext
specify being shown slice labels.
to show percents, need set "[[percents]]%"
.
var chart = amcharts.makechart("chartdiv", { "type": "pie", "theme": "light", "dataprovider": [{ "country": "lithuania", "litres": 501.9 }, { "country": "czech republic", "litres": 301.9 }, { "country": "ireland", "litres": 201.1 }, { "country": "germany", "litres": 165.8 }, { "country": "australia", "litres": 139.9 }, { "country": "austria", "litres": 128.3 }, { "country": "uk", "litres": 99 }, { "country": "belgium", "litres": 60 }, { "country": "the netherlands", "litres": 50 }], "valuefield": "litres", "titlefield": "country", "labeltext": "[[percents]]%" });
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script> <script src="http://www.amcharts.com/lib/3/pie.js"></script> <script src="http://www.amcharts.com/lib/3/themes/light.js"></script> <div id="chartdiv" style="width: 100%; height: 350px;"></div>
Comments
Post a Comment