Skip to content
A Ruby library to plot charts in PDF files
Ruby Other
  1. Ruby 99.3%
  2. Other 0.7%
Branch: master
Clone or download
kangkyu Merge pull request #61 from Fullscreen/wrap-by-char
For category (x-axis) wrap labels by char, not word
Latest commit 08eae1d May 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin First version of squid. Includes tests, manual. Aug 3, 2015
examples Don't truncate integer axis values Mar 1, 2016
gemfiles Support Rails >= 5.0.0.beta1 Dec 19, 2015
lib For category (x-axis) wrap labels by char, not word May 21, 2019
spec Add test for not raising error May 22, 2019
.gitignore Remove 'rake readme' (move to gh-pages) Aug 29, 2015
.rspec Add `chart` method to Prawn::Document May 27, 2015
.travis.yml Remove support for deprecated Ruby 2.1 Sep 5, 2017
CHANGELOG.md Remove support for deprecated Ruby 2.1 Sep 5, 2017
Gemfile
MIT-LICENSE First version of squid. Includes tests, manual. Aug 3, 2015
README.md Remove support for deprecated Ruby 2.1 Sep 5, 2017
Rakefile Remove 'rake readme' (move to gh-pages) Aug 29, 2015
squid.gemspec

README.md

Squid

Squid helps you write Ruby code to draw graphs in PDF files.

The source code is available on GitHub and the documentation on RubyDoc.

Build Status Coverage Status Dependency Status Code Climate Online docs Gem Version

Prawn is a great Ruby library to generate PDF files but lacks high-level components to draw graphs.

Squid adds a single method chart(data = {}, options = {}) to Prawn.

Provide the data to plot as a hash, with each key/value representing a series.

For instance, the following code generates the graph below:

data = {views: {2013 => 182, 2014 => 46, 2015 => 134}}
chart data

01-basic

A comprehensive guide to Squid options

All the settings available for the chart method are detailed on the Squid homepage:

Squid homepage

Please proceed to http://fullscreen.github.io/squid for more details and examples.

How to install

Squid requires Ruby 2.2 or higher. If used in a Rails project, requires Rails 4.0 or higher.

To include in your project, add gem 'squid', '~> 1.4' to the Gemfile file of your Ruby project.

How to generate the manual

rake manual

How to contribute

If you’ve made it this far in the README… thanks! ✌️ Feel free to try it the gem, explore the code, and send issues or pull requests.

All pull requests will have to make Travis and Code Climate happy in order to be accepted. 😙

You can also run the tests locally with bundle exec rspec.

Happy hacking!

You can’t perform that action at this time.