HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function() {
2
3
// create a data set
4
var data = anychart.data.set([
5
["QTR1", 10000, 12500],
6
["QTR2", 12000, 15000],
7
["QTR3", 13000, 16500],
8
["QTR4", 10000, 13000],
9
]);
10
11
// map the data
12
var seriesData_1 = data.mapAs({x: 0, value: 1});
13
var seriesData_2 = data.mapAs({x: 0, value: 2});
14
15
// create a chart
16
var chart = anychart.barmekko();
17
18
// create the first series
19
var series1 = chart.mekko(seriesData_1);
20
21
// configure the visual settings of the first series
22
series1.fill("#00cc99", 0.3);
23
series1.hoverFill("#00cc99", 0.3);
24
series1.selectFill("#00cc99", 0.5);
25
26
// create the second series
27
var series2 = chart.mekko(seriesData_2);
28
29
// configure the visual settings of the second series
30
series2.fill("#0066cc", 0.3);
31
series2.hoverFill("#0066cc", 0.3);
32
series2.selectFill("#0066cc", 0.5);
33
series2.hatchFill("zigzag", "#808080", 1, 15);
34
series2.stroke("#0066cc");
35
series2.hoverStroke("#0066cc", 2);
36
series2.selectStroke("#0066cc", 4);
37
38
// set the container id
39
chart.container("container");
40
41
// initiate drawing the chart
42
chart.draw();
43
});