No commit activity in last 3 years
No release in over 3 years
canvas server exporting for Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 3.2.1, ~> 3.2

Runtime

>= 1.9.8.0, ~> 1.9
< 5, >= 3.2
 Project Readme

canvas_exporting

Controller action to allow export of CanvasJS chart to png/jpg file.

Installation

Add this line to your application's Gemfile:

gem 'canvas_exporting'

And then execute:

$ bundle

Or install it yourself as:

$ gem install canvas_exporting

Usage

Add canvas_controller.rb and add route post 'canvas/export'.

class CanvasController < ApplicationController
  include CanvasExporting::Exporter

end

Config url /canvas/export for canvas exporting.

OR

Using curl:

Curl::Easy.http_post("http://localhost:3000/canvas/export",
Curl::PostField.content('options', options_JSON.to_s),
Curl::PostField.content('type', 'image/png'),
Curl::PostField.content('callback', cb_js_filename),
Curl::PostField.content('width', '400'),
Curl::PostField.content('outputpath', path_to_image_file),
Curl::PostField.content('filename', image_filename) )

References

https://github.com/bastengao/highcharts_exporting

Contributing

  1. Fork it ( https://github.com/notch8/canvas_exporting/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request