Initial commit,修正
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Highcharts Example</title>
|
||||
|
||||
<script type="text/javascript" src="http://cdn.hcharts.cn/jquery/jquery-1.8.2.min.js"></script>
|
||||
<style type="text/css">
|
||||
${demo.css}
|
||||
</style>
|
||||
<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;
|
||||
}());
|
||||
|
||||
// Build the chart
|
||||
$('#container').highcharts({
|
||||
chart: {
|
||||
plotBackgroundColor: null,
|
||||
plotBorderWidth: null,
|
||||
plotShadow: false,
|
||||
type: 'pie'
|
||||
},
|
||||
title: {
|
||||
text: 'Browser market shares at a specific website, 2014'
|
||||
},
|
||||
tooltip: {
|
||||
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
|
||||
},
|
||||
plotOptions: {
|
||||
pie: {
|
||||
allowPointSelect: true,
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
|
||||
style: {
|
||||
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: "Brands",
|
||||
colorByPoint: true,
|
||||
data: [
|
||||
{name: "Microsoft Internet Explorer", y: 56.33},
|
||||
{name: "Chrome", y: 24.030000000000005},
|
||||
{name: "Firefox", y: 10.38},
|
||||
{name: "Safari", y: 4.77},
|
||||
{name: "Opera", y: 0.9100000000000001},
|
||||
{name: "Proprietary or Undetectable", y: 0.2}
|
||||
]
|
||||
}]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="../../js/highcharts.js"></script>
|
||||
<script src="../../js/modules/exporting.js"></script>
|
||||
|
||||
<div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user