HTMLcopy
1
<button onclick="chart.shareWithFacebook();">Share with Facebook</button>
2
<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
anychart.onDocumentReady(function () {
3
chart = anychart.waterfall([
4
{x: 'Net Sales', value: 5085000},
5
{x: 'Cost of Sales', value: -1250450},
6
{x: 'Gross Income', isTotal: true},
7
{x: 'Operating Expenses', value: -2350050},
8
{x: 'Operating Income', isTotal: true},
9
{x: 'Other Income', value: 750000},
10
{x: 'Extraordinary Gain', value: -230050}
11
]);
12
13
// To work with exports you need to reference the exports module from AnyChart CDN
14
// (https://cdn.anychart.com/releases/8.13.0/js/anychart-exports.min.js for latest or https://cdn.anychart.com/releases/8.13.0/js/anychart-exports.min.js for the versioned file)
15
16
// Set exports settings.
17
chart.exports({facebook: {caption: 'ANYCHART.COM', description: 'Waterfall chart'}});
18
19
chart.title('Set exports settings');
20
chart.container('container');
21
chart.draw();
22
});