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
var data = [
4
{x: "Boeotians", value: 50},
5
{x: "Minyans", value: 30},
6
{x: "Phocēans", value: 40},
7
{x: "Locrians", value: 40},
8
{x: "Abantes", value: 40},
9
{x: "Athenians", value: 50}
10
];
11
12
// chart type
13
var chart = anychart.column();
14
15
// set title
16
chart.title("Labels: Minimum and Maximum Labels Coloring");
17
18
// create a series
19
series = chart.column(data);
20
21
// configure min and max labels
22
series.normal().maxLabels(true);
23
series.normal().maxLabels().fontColor("red");
24
series.hovered().maxLabels().fontSize(16);
25
26
series.normal().minLabels(true);
27
series.normal().minLabels().fontColor("green");
28
series.hovered().minLabels().fontSize(16);
29
30
// assign a container and draw a chart
31
chart.container("container");
32
chart.draw();
33
});