Socket
Book a DemoInstallSign in
Socket

quacky-charts

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quacky-charts

0.0.9
bundlerRubygems
Version published
Maintainers
1
Created
Source

About

QuackyCharts is a graphing gem I'm working on. It provides a Ruby syntax for initializing and configuring pie charts and line graphs with D3 and Rickshaw.

Installation

Add this line to your application's Gemfile:

	gem 'quacky-charts'

And then execute:

	$ bundle

Run this command to install the needed JS files:

	$ rails generate quacky:install

Usage

Add this line to the controller:

	@chart = Quacky::PieChartBuilder.new
	

If you want to add some custom data (otherwise you'll get dummy data):

	@chart.add_data( { "label" => "Category A", "value" => 20 } )
	@chart.add_data( { "label" => "Category B", "value" => 60 } )
	

and in the view:

	<%= @chart.draw %>
	

To draw a line graph:

example_data = [{ time: Time.now, data: 50 },{ time: Time.now + 1.hour, data: 75 },{ time: Time.now + 2.hours, data: 25 }]
@line_graph = Quacky::LineGraphBuilder.new(example_data)

and in the view:

<%= @line_graph.draw %>
	

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Added some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 02 Feb 2013

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.