Getting StartedPerformance !!!Chart DataBar and Column ChartsLine and Area ChartsPie and Funnel ChartsScatter and Bubble ChartsRadar and Polar ChartsFinancial ChartsGantt ChartsCombinational ChartsDynamic ChartsWorking with Chart AxesChart FeaturesCustomizing ChartClient-Side Events |
This sample demonstrates the Doughnut chart type.
For detailed implementation, please take a look at the HTML code tab. <!DOCTYPE html> <html> <head> <title> Doughnut Chart Example - JavaScript Chart by DataViz Charts </title> <link rel="stylesheet" type="text/css" href="../../css/dataviz.chart.css" /> <link rel="stylesheet" type="text/css" href="../../themes/le-frog/styles.css" /> <script src="../../js/dataviz.chart.min.js" type="text/javascript"></script> <script lang="javascript" type="text/javascript"> var background = { type: 'linearGradient', x0: 0, y0: 0, x1: 0, y1: 1, colorStops: [{ offset: 0, color: '#d2e6c9' }, { offset: 1, color: 'white' }] }; var chart = new DataViz.Chart({ title: { text: 'Doughnut Chart' }, legend: { title: 'Countries' }, border: { strokeStyle: '#6ba851' }, background: background, animation: { duration: 1 }, shadows: { enabled: true }, series: [ { type: 'doughnut', innerExtent: 0.5, outerExtent: 1.0, fillStyles: ['#418CF0', '#FCB441', '#E0400A', '#056492', '#BFBFBF', '#1A3B69', '#FFE382'], labels: { stringFormat: '%.1f%%', valueType: 'percentage', font: '15px sans-serif', fillStyle: 'white' }, data: [['United States', 65], ['United Kingdom', 58], ['Germany', 30], ['India', 60], ['Russia', 65], ['China', 75]] } ] }); chart.write('container'); </script> </head> <body> <div> <div id="container" style="width: 500px; height: 300px;"> </div> </div> </body> </html> |