Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

my_chart

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

my_chart

  • 0.1.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

MyChart.js

generate chart.js html with ruby

Installation

Add this line to your application's Gemfile:

gem 'my_chart'

And then execute:

$ bundle

Or install it yourself as:

$ gem install my_chart

Usage

suppose you want to have some statistic on mail files:

MyChart.js do

  material do
    # load mail objects here
  end

  select :fail do |m|
    m.fail?
  end

  line :day, :fail?, w: 1280, h: 500, asc: :key

  bar :day, w: 1280, h: 500

  bar :day, w: 1280, h: 500, from: :fail

  output './mail_statistic.htm'
end

execute the script:

    $ mychart.js mail_st.rb

Supported charts

bar, doughnut, line, pie, polar_area, radar are built-in with basic style

if you would like to add custom style, this is for your reference:

class Bar < MyChartType::Proto

  def concrete_type
    :bar
  end

  def concrete_options
    {
       scales: {
         yAxes: [{
             ticks: {
                 beginAtZero:true
             }
         }]
       }
     }
  end

end

FAQs

Package last updated on 11 Feb 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc