Giter VIP home page Giter VIP logo

jquery.flot.saveasimage.js's Introduction

jquery.flot.saveAsImage.js

Flot plugin that adds a function to allow user save the current graph as an image by right clicking on the graph and then choose "Save image as ..." to local disk.

Copyright (c) 2013 http://zizhujy.com. Licensed under the MIT license.

##Screen shot:## http://zizhujy.com/blog/post/2013/07/02/A-Flot-plugin-for-saving-canvas-image-to-local-disk.aspx

##Usage:## Inside the area of your html page, add the following lines:

<script type="text/javascript" src="http://zizhujy.com/Scripts/base64.js"></script>
<script type="text/javascript" src="http://zizhujy.com/Scripts/drawing/canvas2image.js"></script>
<script type="text/javascript" src="http://zizhujy.com/Scripts/flot/jquery.flot.saveAsImage.js"></script>

Now you are all set. Right click on your flot canvas, you will see the "Save image as ..." option.

##Online examples:## http://zizhujy.com/FunctionGrapher is using it, you can try right clicking on the function graphs and you will see you can save the image to local disk.

##Dependencies:## This plugin references the base64.js and canvas2image.js.

##Customizations:## The default behavior of this plugin is dynamically creating an image from the flot canvas, and then puts the image above the flot canvas. If you want to add some css effects on to the dynamically created image, you can apply whatever css styles on to it, only remember to make sure the css class name is set correspondingly by the options object of this plugin. You can also customize the image format through this options object:

options: {
    imageClassName: "canvas-image",
    imageFormat: "png"
}

jquery.flot.saveasimage.js's People

Watchers

Michael Gärtner 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.