HTMLcopy
1
<button onclick="continuous();">'Continuous' mode</button>
2
<button onclick="discrete();">'Discrete' mode</button>
3
<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
var chart;
2
3
function continuous() {
4
5
// Set scale mode to 'continuous'
6
chart.xScale().mode('continuous');
7
}
8
9
function discrete() {
10
11
// Set scale mode to 'discrete'
12
chart.xScale().mode('discrete');
13
}
14
15
anychart.onDocumentReady(function () {
16
chart = anychart.area([
17
{x: 'Sunday', value: 1.1},
18
{x: 'Monday', value: 1.4},
19
{x: 'Tuesday', value: 1.2},
20
{x: 'Wednesday', value: 1.5},
21
{x: 'Thursday', value: 1.3},
22
{x: 'Friday', value: 1.7},
23
{x: 'Saturday', value: 1.4}
24
]);
25
chart.title('Set the scale mode for the continuous series');
26
chart.container('container');
27
chart.draw();
28
});