HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 90%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
// create data set on our data
3
chartData = {
4
title: 'titre',
5
header: ['#', 'actions achevées','actions lancées','études achevées et validées',
6
'études préopérationnelles', 'études de faisabilité','abandon'
7
],
8
rows: [
9
10
['Local(L)',2,0,0],
11
['Communautaire(C)',0,1,0,3,4,0],
12
['(L)+(C)',0,1,0,5,0,0],
13
['Métropolitain(M)',0,0,0,0,1,0],
14
['(C)+(M)',3,2,2,2,0,0],
15
['(L)+(C)+(M)',4,0,0,2,0,0],
16
17
18
]
19
};
20
21
22
// create column chart
23
var chart = anychart.column3d();
24
25
// set chart data
26
chart.data(chartData);
27
28
// turn on chart animation
29
chart.animation(true);
30
31
chart.yAxis().labels().format('{%Value}{groupsSeparator: }');
32
33
// set titles for Y-axis
34
chart.yAxis().title('Nombre d actions');
35
36
// turn on legend
37
chart.legend()
38
.enabled(true)
39
.fontSize(10
40
)
41
.padding([0, 0, 20, 0]);
42
43
// set interactivity settings
44
chart.interactivity().hoverMode('single');
45
46
// set tooltip settings
47
chart.tooltip()
48
.positionMode('point')
49
.position('center-top')
50
.anchor('center-bottom')
51
.offsetX(10)
52
.offsetY(10)
53
.format('{%SeriesName}: ${%Value}{groupsSeparator: }');
54
55
// set 3D settings
56
chart.zAspect(25)
57
.zPadding(30)
58
.zAngle(50
59
)
60
.zDistribution(true);
61
62
// set container id for the chart
63
chart.container('container');
64
65
// initiate chart drawing
66
chart.draw();
67
});