HTMLcopy
1
<div id="container"></div>
2
<div style="position: absolute; top: 40px; right: 25px; width: 31%;">
3
<input style="margin-bottom: 10px;" type="button" value="getPdfBase64String" onclick="getPdfBase64String()">
4
<textarea style="width: 100%;" rows="5" cols="70" id="getPdfBase64String"></textarea>
5
</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
chart.margin([0, '45%', 0, 0]);
13
chart.title('Returns PDF as base64 string');
14
chart.container('container');
15
chart.draw();
16
});
17
18
function getPdfBase64String() {
19
20
// Get PDF as base64 string
21
chart.getPdfBase64String(function (response) {
22
var base64String = document.getElementById('getPdfBase64String');
23
base64String.innerHTML = response;
24
});
25
}