Home
Tutorials
Microsoft Technologies Tutorials
Java Programming Tutorials
Web Designing Tutorials
Script Programming Tutorials
Database Programming Tutorials
Mobile Technologies Tutorials
Other Programming Tutorials
Examples
Articles
Tools
News
Highcharts Pie with Monochrome Fill Chart Example
Keywords : Pie chart with monochrome fill options using highcharts example, How to use highcharts pie chart with monochrome fill options example, Pie with monochrome fill options example in highcharts
Example
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Highcharts Pie with monochrome fill Chart</title> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.highcharts.com/highcharts.js"></script> <script src="https://code.highcharts.com/modules/exporting.js"></script> <script type="text/javascript"> $(function () { // Make monochrome colors and set them as default for all pies Highcharts.getOptions().plotOptions.pie.colors = (function () { var colors = [], base = Highcharts.getOptions().colors[0], i; for (i = 0; i < 10; i += 1) { // Start out with a darkened base color (negative brighten), and end // up with a much brighter color colors.push(Highcharts.Color(base).brighten((i - 3) / 7).get()); } return colors; }()); var chartype = { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false, type: 'pie' } var chartitle = { text: 'Browser market shares at a specific website, 2014' } var chartooltip = { pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>' } var chartplotoptions = { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, format: '<b>{point.name}</b>: {point.percentage:.1f} %', style: { color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' } } } } var chartseries = [{ name: 'Brands', data: [ { name: 'Microsoft Internet Explorer', y: 56.33 }, { name: 'Chrome', y: 24.03 }, { name: 'Firefox', y: 10.38 }, { name: 'Safari', y: 4.77 }, { name: 'Opera', y: 0.91 }, { name: 'Proprietary or Undetectable', y: 0.2 } ] }] $('#container').highcharts({ chart:chartype, title: chartitle, tooltip: chartooltip, plotOptions: chartplotoptions, series: chartseries }); }); </script> </head> <body> <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div> </body> </html>
Click Here to See Result
Result
Previous
Next