Socket
Book a DemoInstallSign in
Socket

bitcharts

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcharts

0.0.4
bundlerRubygems
Version published
Maintainers
1
Created
Source

= Bitcharts

== Usage

=== Mount Engine in +routes.rb+

mount Bitcharts::Engine => "/bitcharts"

=== Generate a chart

rails g bitcharts:chart user_logins

or a scoped chart:

rails g bitcharts:scoped_chart user_logins

=== Implement chart's value method

Change the generated method in +app/charts/user_logins_chart.rb+:

def value(date_range) User::Login.where(created_at: date_range).count end

=== Add canvas to your view

<%= bitchart 'user_logins', from: 7.days.ago, to: Date.today %>

Check +Bitcharts::ApplicationHelper+ for all available options.

=== Add Javascript

Require Javascript in your applications Javascript or load it dynamically in your view when needed:

<%= javascript_include_tag 'bitcharts/default' %>

If you don't use jQuery already use +bitcharts/full+ instead.

=== Authorization

rails g bitcharts:install

This generates an initializer that shows you how to authorize with CanCan(Can) based on the chart's class name. Adopt it as needed.

FAQs

Package last updated on 28 Aug 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.