02. 半径分割


示例

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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>雷达图 - 半径分割</title>
</head>

<body>
<div id='E2' style='position:relative; width: 600px; height:300px; '></div>

<script src='../dist/radar.js'></script>
<script>

createChart('E2');

function createChart(divID)
{
//1. 生成图表对象
let chart = new T.radar.Chart(divID);

//2. 停止图表绘制
chart.stop() ;

//3. 准备数据
let series1 = new T.radar.Series();
series1.name = '系列1';
series1.data =[ 125 , 300 , 250,100,200 ];

let series2 = new T.radar.Series();
series2.name = '系列2';
series2.data =[ 200 , 350 , 200,50,150 ];

let series3 = new T.radar.Series();
series3.name = '系列3';
series3.data =[ 0 , 150 , 150,200,100 ];

//4. 设置图表信息
let chartInfo_In = chart.chartInfo_In ;
chartInfo_In.title = '雷达图';
chartInfo_In.splitNumber = 3 ;
chartInfo_In.indicator = [ {name: '语文', max: 250} ,{name: '数学', max: 400} ,{name: '英语', max: 250} ,{name: '化学', max: 250} ,{name: '物理', max: 250} ] ;
chartInfo_In.series = [series1,series2,series3];

//5. 开始图表绘制
chart.start();
}
</script>

</body>
</html>