Socket
Book a DemoInstallSign in
Socket

d3_charts

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3_charts

0.1.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

d3_charts

Build Status Gem Version Coverage Status

Rails helpers for building SVG charts using the d3 library.

Installation

Add this line to your application's Gemfile:

gem 'd3_charts'

And then execute:

$ bundle

Or install it yourself as:

$ gem install d3_charts

To make it work you need to require the javascripts in application.js:

//= require d3_charts

To add some basic colouring of pie charts, add the the following in application.css:

*= require 'd3_charts'

Usage

Pie charts

= chart_tag(:pie, data, options)

Available options are:

  • width, defaults to 1000
  • height, defaults to 1000

Which are passed in like so:

= chart_tag(:pie, data, { width: 123, height: 123 })

Area charts

= chart_tag(:area, data, options)

Available options are:

  • width, defaults to 1000
  • height, defaults to 1000
  • date_format, the strftime format of datums as rendered in the chart, defaults to %Y-%m-%d
  • data_date_format, the strftime format of datums as specified in the data, defaults to %Y-%m-%d

Which are passed in like so:

= chart_tag(:area, data, { width: 123, height: 123 })

TODO:

  • More charts:
    • Line Chart
    • Histogram Chart
    • Vertical Bar Chart
    • Horizontal Bar Chart

Contributing

  • Fork it ( https://github.com/tomasc/d3_charts/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

FAQs

Package last updated on 19 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.