0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Create SVG and PNG ChartHelpers. Includes Gantt Charts
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
>= 0
~> 5.0
~> 10.0

Runtime

 Project Readme

Chart Helpers

Chart Helpers is a gem that can parse markdown-like text and turn it into SVG files.

Gantt Chart

Installation

Add this line to your application's Gemfile:

gem 'chart_helpers'

And then execute:

$ bundle

Or install it yourself as:

$ gem install charts_helpers

Usage

Gantt Chart

require 'charts_helpers'

chart = <<EOF
gantt
title My Title
numberFormat .%2f

row 0, :group1, 0.000, 0.100
row 1, :group1, 0.100, 0.200
row 2, :group1, 0.200, 0.300
EOF
ChartHelpers.render_chart(chart, 'my_chart.svg')

Flowchart

require 'charts_helpers'

chart = <<EOF
graph
A-->B
subgraph Name
  B--text-->C
end
EOF
ChartHelpers.render_chart(chart, 'my_chart.svg')

Supported arrows:

Line Type
A-->B Solid arrow
B---C Solid line
C--text-->D Solid arrow with label
D--text---E Solid line with label
E-.text.->F Dotted arrow with label
F-.->G Dotted arrow
G==>H Bold arrow
H==text===>I Bold line with text

DOT Format

Full support for GraphViz's .dot format

require 'charts_helpers'

chart = <<EOF
graph graphname {
  a -- b -- c;
  b -- d;
}
EOF
ChartHelpers.render_chart(chart, 'my_chart.svg')

Development

After checking out the repo, run bin/setup to install dependencies. It is developed using the ruby version indicated in dev.yml. You will also need the homebrew packages listed in dev.yml, or the corresponding Linux packages if you are using Linux.

Then, run bin/testunit to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ChartHelpers. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.