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 data set
4
var data = [
5
{x: "Department Stores1", value: 737166},
6
{x: "Discount Stores", value: 537166},
7
{x: "Men\'s/Women\'s Specialty Stores", value: 188662},
8
{x: "Juvenile Specialty Stores", value: 178662},
9
{x: "All other outlets", value: 89000}
10
];
11
12
// create bar chart
13
var chart = anychart.bar();
14
15
var series = chart.bar(data);
16
series
17
.fill("#6698FF .6")
18
.hovered().stroke("#0000A0", 4)
19
.stroke("#56561a", 4)
20
.hatchFill("diagonal-brick", "#348781")
21
.hovered().hatchFill("diagonal-brick", "#0000A0")
22
23
series.tooltip().enabled(true).title().enabled(true).text("Information:");
24
series.labels().enabled(true).anchor("left-center").position("right-center").fontSize(13);
25
26
// set container id for the chart
27
chart.container("container");
28
29
// set scale minimum
30
chart.yScale().minimum(0);
31
chart.title("Bar Chart With A Custom View");
32
// initiate chart drawing
33
chart.draw();
34
});