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 data
4
// drawConnector: false in the '2023' point force chart not to draw a connector from it to the next point
5
var data = [
6
{x: "2022", value: 23},
7
{x: "Q1", value: -12},
8
{x: "Q2", value: 16},
9
{x: "Q3", value: 9},
10
{x: "Q4", value: 7},
11
{x: "2023", isTotal: true, drawConnector: false},
12
{x: "Total", isTotal: true},
13
];
14
15
// create a waterfall chart
16
var chart = anychart.waterfall();
17
18
// create a series and set the data
19
var series = chart.waterfall(data);
20
21
// set the chart title
22
chart.title("Waterfall Chart: Omit Connector");
23
24
// set the data mode
25
chart.dataMode("diff");
26
27
// set the container id
28
chart.container("container");
29
30
// initiate drawing the chart
31
chart.draw();
32
});