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
var data = [
3
{x: 'Food is tasteless', value: 65},
4
{x: 'Wait time', value: 109},
5
{x: 'Unfriendly staff', value: 12.5},
6
{x: 'Not clean', value: 45},
7
{x: 'Overpriced', value: 250},
8
{x: 'To noisy', value: 27},
9
];
10
11
// create a Pareto chart with data
12
var chart = anychart.pareto(data);
13
14
// get the column series and format tooltip
15
chart.getSeriesAt(0).tooltip().format("Value: {%value}");
16
17
// get the line series and format tooltip
18
chart.getSeriesAt(1).tooltip().format("Cumulative Frequency: {%CF}% \n Relative Frequency: {%RF}%");
19
20
// set chart title text settings
21
chart.title("Pareto chart: tooltip configuration");
22
23
// set container id for the chart
24
chart.container('container');
25
// initiate chart drawing
26
chart.draw();
27
});