GithubHelp home page GithubHelp logo

dwaan / highcharts-export-clientside Goto Github PK

View Code? Open in Web Editor NEW

This project forked from a----/highcharts-export-clientside

0.0 2.0 0.0 3.61 MB

Module for Highcharts to exports charts client-side

Home Page: http://a----.github.io/highcharts-export-clientside/

License: The Unlicense

HTML 17.81% JavaScript 82.19%

highcharts-export-clientside's Introduction

highcharts-export-clientside

Module for HighCharts to exports charts client-side.

Webpage for this project is here: http://a----.github.io/highcharts-export-clientside/

You may need to export a chart you made using HighCharts to an image or a PDF. It has an exporting module but it relies on an export server, which by default is http://export.highcharts.com/ and you also –unlucky you– have one or more of the following:

  • your app doesn't have access to the intertubes;
  • your chart contains sensitive data and you don't want an unsecure channel to carry it;
  • sensitive data or not, you don't trust HighCharts with it;
  • it's against your company policies;
  • you don't want to set an export server up;
  • you think it's 2015 and FFS, browsers should be able to do that.

Additionally, it provides a common interface between the official export module and export-csv.

Build / Install

Dependencies are not shipped, so you'll have to do the following:

bower install

Boom, you're done. Check the example.html file and mess with it.

Or just get highcharts-export-clientside.js.

Dependencies

This module depends on:

  • HighCharts obviously, remember guys, it isn't free for commercial usages;
  • its exporting module, that is bundle with it;
  • for rasterized images (PNG, JPEG), a module called canvas-tools with is based1 on canvg licenced under MIT Licence;
  • jsPDF (its GitHub page is overthere) for PDF support, licenced under MIT Licence;
  • Pseudo-official export-csv module for CSV and XLS support, under MIT Licence.

The only dependencies you must use are HighCharts and HighCharts exporting module. If you want PNG/JPEG, add canvas-tools. If you want PDF support, add both canvas-tools and jsPDF. If a dependency is missing for a file type, the option will not be available in the export menu.

1 There are issues with canvg, title/subtitle appearing twice, this kind of things which canvas-tools fixes. So I'd suggest to go with this one.

Remarks, Issues, Other stuff

  • Rasterized images have an aspect ratio issue. I probably made a boo-boo somewhere. That's fixed.
  • This probably won't work on Internet Explorer has it uses HTML5 download feature and opens a data-uri as a fallback. But IE has limited data-uri support so who knows. Nope, but there are some shim/sham/polyfills so that's possible to do.
  • When exporting into PDF, sourceWidth and sourceHeight are expressed in millimeters.

Changelog

v1.0.1 – 2015-04-27

## Credits

Written with the help of the following resources:

highcharts-export-clientside's People

Contributors

a---- avatar dwaan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.