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
anychart.format.inputLocale('fr-fr');
4
anychart.format.inputDateTimeFormat('yyyy.MM.dd');
5
anychart.format.outputLocale('it-it');
6
anychart.format.outputDateTimeFormat('dd MMMM yyyy');
7
8
var chart = anychart.line([
9
{x: Date.UTC(2014, 5, 6), value: 511.53},
10
{x: Date.UTC(2014, 6, 8), value: 900},
11
{x: Date.UTC(2014, 9, 10), value: 700},
12
{x: Date.UTC(2014, 10, 12), value: 380},
13
{x: Date.UTC(2014, 12, 14), value: 830}
14
]);
15
16
var allLocales = 'Defined locales: ';
17
for (localeName in anychart.format.locales) {
18
allLocales += localeName + ' '
19
}
20
// Set used locales.
21
chart.title(allLocales);
22
23
var axis = chart.xAxis();
24
25
var formatLabels = axis.labels();
26
formatLabels.format(function() {
27
return anychart.format.dateTime(this.value);
28
});
29
30
chart.title('Set a few localization');
31
chart.container('container');
32
chart.draw();
33
});