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 chart
4
var chart = anychart.pareto([
5
{x: "Defect 1", value: 19},
6
{x: "Defect 2", value: 9},
7
{x: "Defect 3", value: 28},
8
{x: "Defect 4", value: 87},
9
{x: "Defect 5", value: 14},
10
]);
11
12
// set the chart title
13
chart.title("Pareto Chart: Appearance");
14
15
// configure the visual settings of the first series
16
chart.getSeries(0).normal().fill("#0066cc", 0.3);
17
chart.getSeries(0).hovered().fill("#0066cc", 0.1);
18
chart.getSeries(0).selected().fill("#0066cc", 0.5);
19
chart.getSeries(0).normal().hatchFill("forward-diagonal", "#0066cc", 1, 15);
20
chart.getSeries(0).hovered().hatchFill("forward-diagonal", "#0066cc", 1, 15);
21
chart.getSeries(0).selected().hatchFill("forward-diagonal", "#0066cc", 1, 15);
22
chart.getSeries(0).normal().stroke("#0066cc");
23
chart.getSeries(0).hovered().stroke("#0066cc", 2);
24
chart.getSeries(0).selected().stroke("#0066cc", 4);
25
26
// configure the visual settings of the second series
27
chart.getSeries(1).normal().stroke("#0066cc", 4, "4 4", "round");
28
29
// set the container id
30
chart.container("container");
31
32
// initiate drawing the chart
33
chart.draw();
34
});