-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtree chart.html
More file actions
74 lines (72 loc) · 1.7 KB
/
tree chart.html
File metadata and controls
74 lines (72 loc) · 1.7 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Distributed Treemap</title>
<!-- ApexCharts CDN -->
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
</head>
<body>
<div id="chart" style="max-width: 650px; margin: 35px auto;"></div>
<script>
var options = {
series: [
{
data: [
{ x: 'New Delhi', y: 218 },
{ x: 'Kolkata', y: 149 },
{ x: 'Mumbai', y: 184 },
{ x: 'Ahmedabad', y: 55 },
{ x: 'Bangaluru', y: 84 },
{ x: 'Pune', y: 31 },
{ x: 'Chennai', y: 70 },
{ x: 'Jaipur', y: 30 },
{ x: 'Surat', y: 44 },
{ x: 'Hyderabad', y: 68 },
{ x: 'Lucknow', y: 28 },
{ x: 'Indore', y: 19 },
{ x: 'Kanpur', y: 29 }
]
}
],
legend: {
show: false
},
chart: {
height: 350,
type: 'treemap',
toolbar: {
show: false, // Disable the toolbar
},
},
title: {
text: 'Distributed Treemap (different color for each cell)',
align: 'center'
},
colors: [
'#3B93A5',
'#F7B844',
'#ADD8C7',
'#EC3C65',
'#CDD7B6',
'#C1F666',
'#D43F97',
'#1E5D8C',
'#421243',
'#7F94B0',
'#EF6537',
'#C0ADDB'
],
plotOptions: {
treemap: {
distributed: true,
enableShades: false
}
}
};
var chart = new ApexCharts(document.querySelector("#chart"), options);
chart.render();
</script>
</body>
</html>