UNPKG

realchart-export

Version:

Wooritech realchart exporting moudle

60 lines (46 loc) 1.27 kB
# realchart-export This is just a realchart-export module copied from realchart v1.0.1 This package is generated for simplicity of use. ## Installation The package expects that global realchart variable is set. It also doesn't export anything. ```sh npm2yarn npm install realchart-export ``` ```ts import { RealchartExport } from "realchart-export"; import "realchart-export/dist/realchart-export.css"; ``` Or include the script in your HTML file. ```html <link href="./styles/realchart-export.css" rel="stylesheet"> <script src = "./lib/realchart-export/index.js"> ``` ## Basic Use ```js const config = { export: { useLibrary: true, menus: ['png', 'jpeg', 'svg'], hideScrollbar: true, hideNavigator: true, hideZoomButton: true, ... } }; const chart = Realchart.createChart(document, id, config); chart.export({ type: 'png', fileName: 'realchart' }); ``` ```ts import { createChart } from "realchart"; import { RealchartExport } from "realchart-export"; import "realchart/dist/realchart-style.css"; import "realchart-export/dist/realchart-export.css"; const chart = createChart(document, id, config); RealchartExport(chart); chart.export({ type: 'png', fileName: 'realchart' }); ```