
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Chart Candy use D3.js library to quickly render AJAX charts in your Rails project. In a minimum amount of code, you should have a functional chart, styled and good to go.
gem install chart-candy
In your Gemfile:
gem 'chart-candy'
First you need to link the assets.
In your css manifest put : require chart_candy
In your javascript manifest put : require chart_candy
In your layout you must link the D3.js library. You can use the following helper method in order to do that.
<%= d3_include_tag %>
Now, you're ready to add some charts to your project! Chart Candy currently offer 3 chart types : line, donut and counter.
You must create a class that will build the JSON data for the chart. We suggest to create a app/charts directory in your Rails project to hold all your charts. For example, if I want the chart of downloaded books, I would create app/charts/downloaded_books_chart.rb.
class DownloadedBooksChart < ChartCandy::BaseChart
def build(chart)
downloads = [ {"time"=>Time.now - 4.months, "value"=>69}, {"time"=>Time.now - 3.months, "value"=>74}, {"time"=>Time.now - 2.months, "value"=>83}, {"time"=>Time.now - 1.months, "value"=>84} ]
chart.add_x_axis :date, downloads
chart.add_y_axis :number, downloads
chart.add_line 'downloads', downloads
end
end
This build method will be call by the AJAX chart.
In your view, you call the chart.
<%= line_chart 'downloaded-book' %>
Chart Candy use Rails I18n to manage text. In order to manage the labels on the chart you'll have to create a YAML that looks like that :
fr:
chart_candy:
downloaded_books:
title: "Downloaded Books from my Library"
axis:
x:
label: "Period"
y:
label: "Quantity"
lines:
downloads:
label: "Quantity of downloads"
unit: "downloads"
Coming Soon
Coming Soon
Copyright (c) 2012 De Marque inc. See LICENSE for further details.DownloadedBooks
FAQs
Unknown package
We found that chart-candy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.