series: [{ type: 'pie', name: 'Browser share', data: [ ['Firefox', 45.0], ['IE', 26.8], { name: 'Chrome', y: 12.8, sliced: true, selected: true }, ['Safari', 8.5], ['Opera', 6.2], ['Others', 0.7] ] }]
Mainly refer to this section:
{name: 'Chrome',y: 12.8,sliced: true,selected: true}
FusionCharts<Script type = "text/javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"> </script> <script type = "text/javascript"> $ (function () {var ds = [{"name": "\ u4e0a \ u6d77", "y": 28.2 },{ "name": "\ u5317 \ u4eac", "y ": 48.2 },{ "name": "\ u5e7f \ u4e1c", "y": 18.2}]; // In fact, you only need to display it in json format in the example, such as chrome. // Radialize the colorsHighcharts. getOptions (). colors = Highcharts. map (Highcharts. getOptions (). colors, function (color) {return {radialGradient: {cx: 0.5, cy: 0.3, r: 0.7}, stops: [[0, color], [1, Highcharts. color (color ). brighten (-0.3 ). get ('rgb ')] // darken] };}); // Build the chart $ (' # iner '). highcharts ({chart: {plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false}, title: {text: 'browser market shares at a specific website, 2010 '}, tooltip: {pointFormat: '{series. name }:{Point. percentage:. 1f} %'}, PlotOptions: {pie: {allowPointSelect: true, cursor: 'pointer', dataLabels: {enabled: true, color: '#000000', connectorColor: '#000000 ', formatter: function () {return''+ This. point. name +': '+ This. percentage + '%'; }}}, series: [{type: 'pie ', name: 'browser share', data: ds,}]}); </script><Script src = "js/hc. js"> </script> <script src = "js/modules/exporting. js"> </script>
'Shanghai', 'y' => 28.2), array ('name' => 'beijing', 'y' => 48.2 ), array ('name' => 'guangdong ', 'y' => 18.2),); $ data = json_encode ($ B); echo ($ data);}?>
Below is the json data output by php for js:
Output: {"2": {"name": "lo", "data": [0, 0]}, "3": {"name": "eth0 ", "data": [0.40377, 0.00353]} js call:series: [ds[2], ds[3]]