Skip to content

Fully customizable HTML/CSS charts for Ruby on Rails ๐Ÿ“Š

License

Notifications You must be signed in to change notification settings

matthewh8/purechart

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

46 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PureChart

Fully customizable HTML/CSS charts for Ruby on Rails. PureChart serves as an alternative to other charting libraries that extensively use JavaScript and HTML canvas elements to render charts, resulting in Rails rendering problems and very limited customization options.

Getting Started

Integrating PureChart into your Rails project is incredibly easy. Simply add gem 'purechart' to your Gemfile, run bundle install and you should be all set! Now, use our helpers to generate charts in your html.erb files and create your own style configurations in either YML, TOML, or JSON format in the app/purechart directory of your application.

Note - We're currently working on a documentation website (docs.purechart.org). Check back once in a while for updates!

Examples

Lollipop Chart

Controller

class ChartsController < ApplicationController
    def index
        @data = [
            {
                name: "Burger King",
                color: "#ff7f50",
                value: 1200,
            },
            {
                name: "McDonalds",
                color: "#ff4757",
                value: 500,
            },
            {
                name: "Green Burrito",
                color: "#2ed573",
                value: 780,
            }
        ]

        @axes = {
            horizontal: "Dollars"
        }
    end
end

Optional Style Configuration (app/purechart/custom_bar.yml)

---
labels:
  font: Inter Tight
...

Template

<div class="card">
    <%= lollipop_chart @data, @axes, "custom_bar" %>
</div>

About

Fully customizable HTML/CSS charts for Ruby on Rails ๐Ÿ“Š

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 56.4%
  • Ruby 43.6%