The rendered Range Selector can be exported to JPEG, PNG, SVG, or PDF format by using the export
method in the Range Selector. This method contains the following parameters:
import { SplineSeries, AreaSeries, DateTime, Crosshair } from '@syncfusion/ej2-charts';
import { RangeNavigator, Chart, IChangedEventArgs } from '@syncfusion/ej2-charts';
import { RangeTooltip, Tooltip } from '@syncfusion/ej2-charts';
import { bitCoinData } from './datasource.ts';
RangeNavigator.Inject(AreaSeries, DateTime, RangeTooltip);
let range: RangeNavigator = new RangeNavigator(
{
valueType: 'DateTime',
value: [new Date(2017, 8, 1), new Date(2018, 1, 1)],
tooltip: { enable: true },
series: [
{
dataSource: bitCoinData, xName: 'x', yName: 'y', type: 'Area',
width: 2, animation: { enable: false }
}
],
}
);
range.appendTo('#element');
document.getElementById('export').onclick = () => {
range.export('PNG', 'result', null, [range]);
};
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Animation</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container' style="margin-top: 125px">
<div id='element'></div>
<div id='chart'></div>
<button id= "export" type="button" width ='15%' style="float: right">Export</button>
</div>
</body>
</html>
The rendered Range Selector can be printed directly from the browser by calling the public method print
.
import { SplineSeries, AreaSeries, DateTime, Crosshair } from '@syncfusion/ej2-charts';
import { RangeNavigator, Chart, IChangedEventArgs } from '@syncfusion/ej2-charts';
import { RangeTooltip, Tooltip } from '@syncfusion/ej2-charts';
import { bitCoinData } from './datasource.ts';
RangeNavigator.Inject(AreaSeries, DateTime, RangeTooltip);
let range: RangeNavigator = new RangeNavigator(
{
valueType: 'DateTime',
value: [new Date(2017, 8, 1), new Date(2018, 1, 1)],
tooltip: { enable: true },
series: [
{
dataSource: bitCoinData, xName: 'x', yName: 'y', type: 'Area',
width: 2, animation: { enable: false }
}
],
}
);
range.appendTo('#element');
document.getElementById('print').onclick = () => {
range.print();
};
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Animation</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<body>
<div id='loader'>Loading....</div>
<div id='container' style="margin-top: 125px">
<div id='element'></div>
<div id='chart'></div>
<button id= "print" type="button" width ='15%' style="float: right">Print</button>
</div>
</body>
</html>