HTMLcopy
1
<div id="container"></div>
CSScopy
x
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
7
8
.anychart-tooltip {
9
border-radius: 23px;
10
background: rgba(255, 160, 0, 0.7);
11
font-family: Courier, Helvetica, Arial, 'sans-serif';
12
}
13
14
.anychart-tooltip-separator {
15
height: 3px;
16
background-color: rgba(221, 44, 0, 0.7);
17
}
18
19
.anychart-tooltip-title{
20
font-size: 28px;
21
}
JavaScriptcopy
28
1
anychart.onDocumentReady(function () {
2
3
// create a data set
4
var data = [
5
["John", 10000],
6
["Jake", 12000],
7
["Peter", 18000],
8
["James", 11000],
9
["Mary", 9000]
10
];
11
12
// create a chart and set the data
13
var chart = anychart.column(data);
14
15
// set the chart title
16
chart.title().useHtml(true);
17
chart.title("Tooltip: HTML (CSS Classes)<br><br><span style='font-style:italic'>Sales</span>");
18
19
// configure tooltips
20
chart.tooltip().useHtml(true);
21
chart.tooltip().format("{%value}");
22
23
// set the container id
24
chart.container("container");
25
26
// initiate drawing the chart
27
chart.draw();
28
});