<!DOCTYPE html>
<html>
<head>
<title>A Dial Showing the Degrees of a Circle</title>
<style>
body {
background: #eeeeee;
}
#canvas {
background: #ffffff;
cursor: crosshair;
margin-left: 10px;
margin-top: 10px;
-webkit-box-shadow: 4px 4px 8px rgba(0,0,0,0.5);
-moz-box-shadow: 4px 4px 8px rgba(0,0,0,0.5);
box-shadow: 4px 4px 8px rgba(0,0,0,0.5);
}
</style>
</head>
<body>
<canvas id='canvas' width='850' height='650'>
Canvas not supported
</canvas>
<script >
var canvas = document.getElementById('canvas'),
context = canvas.getContext('2d'),
//圆心
CENTROID_RADIUS = 2,
CENTROID_STROKE_STYLE = 'rgba(0, 0, 0, 0.9)',
CENTROID_FILL_STYLE = 'rgba(80, 190, 240, 0.6)',
RING_INNER_RADIUS = 150,
RING_OUTER_RADIUS = 80,
ANNOTATIONS_FILL_STYLE = 'rgba(0, 0, 230, 0.9)',//数字填充样式
ANNOTATIONS_TEXT_SIZE = 12,
TICK_WIDTH = 10,
TICK_LONG_STROKE_STYLE = 'rgba(100, 140, 230, 0.9)',
TICK_SHORT_STROKE_STYLE = 'rgba(100, 140, 230, 0.7)',
TRACKING_DIAL_STROKING_STYLE = 'rgba(100, 140, 230, 0.5)'