File: piechart2.html

package info (click to toggle)
jsxgraph 1.11.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,984 kB
  • sloc: javascript: 81,688; xml: 5,869; java: 1,072; php: 281; makefile: 189; python: 174; cpp: 76; sh: 12
file content (36 lines) | stat: -rw-r--r-- 1,528 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<html>
	<head>
   		<title>JSXGraph example</title>
		<link rel="stylesheet" type="text/css" href="../distrib/jsxgraph.css" />
		<script type="text/javascript" src="../distrib/jsxgraphcore.js"></script>
	</head>
	<body>
        <div id="jxgbox" class="jxgbox" style="width:900px; height:600px;"></div>
		<!-- Drawing area -->
		<div id="debug" style="display:none;"></div>
		<script type="text/javascript">
    /* <![CDATA[ */

    var dataArr = [30,16,14,10,10,8,6,6];
    var board = JXG.JSXGraph.initBoard('jxgbox', {showNavigation:false, showCopyright:true, originX: 120, originY: 400, unitX: 50, unitY: 50});
    board.containerObj.style.backgroundColor = 'black';
    board.options.text.strokeColor = 'white';
    board.suspendUpdate();

    var a = board.createElement('chart', dataArr,
        {chartStyle:'pie',
         colors:['#0F408D','#6F1B75','#CA147A','#DA2228','#E8801B','#FCF302','#8DC922','#15993C','#87CCEE','#0092CE'],
         fillOpacity:0.8, center:[5,2], strokeColor:'black', highlightStrokeColor:'black', strokeWidth:4,
         labels:['War games','Sport games', 'Old games','Strategy games', '3D games', 'Puzzle games','Board games', 'I do not play games'],
         highlightColors:['#E46F6A','#F9DF82','#F7FA7B','#B0D990','#69BF8E','#BDDDE4','#92C2DF','#637CB0','#AB91BC','#EB8EBF'],
         highlightOnSector:true,
         highlightBySize:true,
         gradient:'linear'
        }
    );
    board.unsuspendUpdate();

  /* ]]> */
  </script>
</body>
</html>