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
43
1
anychart.onDocumentReady(function() {
2
// this column represents JS equivalents every JSON object
3
var chart = anychart.fromJson(
4
{chart:{type: "line", // var chart = anychart.line();
5
6
// set interval of default y scale
7
yScale: {ticks: {interval: 100000}}, // chart.yScale().ticks().interval(100000);
8
9
// settings for custom y scale
10
scales: {"customYScale": { // var customYScale = anychart.scales.linear();
11
type: "linear", // customYScale
12
minimum: 0, // .minimum(0)
13
maximum: 100, // .maximum(100)
14
ticks: { // .ticks()
15
interval: 10}, // .interval(10);
16
minorTicks: {interval: 2} }}, // extraYScale.minorTicks().interval(2);
17
18
// y axes settings
19
yAxes: [{title: "Basic Y Axis" // chart.yAxis().title().text("Basic Y Axis");
20
},{ // chart.yAxis(1)
21
orientation: "right", // .orientation("right")
22
scale: "customYScale", // .scale(customYScale)
23
title:{ // .title()
24
text: "Extra Y Axis"}}], // .text("Extra Y Axis");
25
26
series:[{seriesType: "column", // chart.column([
27
data: [{x: "A", value: 637166}, // ["A", 637166],
28
{x: "B", value: 721630}, // ["B", 721630],
29
{x: "C", value: 148662}, // ["C", 148662],
30
{x: "D", value: 78662}, // ["D", 78662],
31
{x: "E", value: 90000} // ["E", 90000]
32
]},{ // ]);
33
seriesType: "line", // chart.line([
34
data:[{x: "A", value: 95}, // ["A", 95],
35
{x: "B", value: 97}, // ["B", 97],
36
{x: "C", value: 96}, // ["C", 96],
37
{x: "D", value: 70}, // ["D", 70],
38
{x: "E", value: 35}], // ["E", 35]
39
yScale: "customYScale"}], // ]).yScale(customYScale);
40
41
container: "container"}} // chart.container("container")
42
).draw();
43
});