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 = [
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 (Inline Styles)<br><br><span style='font-style:italic'>Sales</span>");
18
19
// configure tooltips
20
chart.tooltip().useHtml(true);
21
chart.tooltip().titleFormat("<img width='20' src='http://cdn.anychart.com/images/anychart-logo-medium.png'> <span style='font-size:28px;font-family:courier'>{%x}");
22
chart.tooltip().format("<span style='font-family:courier'>{%value}</span>");
23
24
// set the container id
25
chart.container("container");
26
27
// initiate drawing the chart
28
chart.draw();
29
});