Questions tagged [chartkick]

Create beautiful Javascript charts with one line of Ruby, Python, Javascript, React, Vue, Elixir, and Clojure.

Chartkick supports Chart.js, Google Charts, and Highcharts and works with most browsers. Also provides server-side integration for Ruby, Python, Elixir, and Clojure

361 questions
0
votes
1 answer

Manipulate value of ActiveRecord request in Chartkick

I like to use chartkick to visualize some data. I have a Purchase model with many purchases in it. class Purchase < ActiveRecord::Base attr_accessible :category, :price, :product, :purchase_type def invert_price self.price.abs end end A…
neonmate
  • 509
  • 4
  • 10
0
votes
1 answer

`require': cannot load such file -- chartkick (LoadError)

I have Sinatra and Chartkick working on a Windows development machine. Now I want to move it to a server so others can easily access it. Here's some relevant details about my server: $ lsb_release -a No LSB modules are available. Distributor ID:…
oaklodge
  • 722
  • 6
  • 19
0
votes
1 answer

Labels and Chartkick

Chartkick is amazing, and I can do super simple things like <%= column_chart Device.joins(:reviews).group(:brand).average(:average_rating) %> and get results like: Now, the problem is that the labels aren't fed through to chartkick. This is what…
Abram
  • 39,950
  • 26
  • 134
  • 184
0
votes
1 answer

'Escape' javascript function within rails statement

I have the following code (using the chartkick gem): <%= pie_chart [[t('result.positive'), @rating_positive], [t('result.negative'), @rating_negative], [t('result.neutral'), @rating_neutral]], colors: ['#B3D986', '#E04848', '#C9C9C9'], …
user720491
  • 589
  • 1
  • 9
  • 20
0
votes
1 answer

why does line_chart in Chartkick has to show time on a date data?

I'ved got a line chart like this with date data (not including time) new Chartkick.LineChart("chart-2", {"2013-02-10": 11, "2013-02-11": 6}); http://jsfiddle.net/yekLh/1/ why does chartkick always have to include time ? how do i show the series…
Axil
  • 3,606
  • 10
  • 62
  • 136
0
votes
2 answers

Setting up ChartKick - Ruby beginner

After reading http://chartkick.com/ I've tried to add chart to my website Gemfile: ... gem 'chartkick' ... index.html.erb: <%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %> <%= pie_chart({"Football" => 10, "Basketball" => 5})…
0
votes
1 answer

Django Chartkick library option issues

I'm having difficulty getting Django Chartkick to work when using the library option. The application is somewhat complex but briefly when I do not use the library option the chart renders. When I do it does not render. More specifically this…
rbell01824
  • 189
  • 4
  • 10
0
votes
1 answer

Chartkick with months name as axis

I am new in ruby and I am having a problem using Chartkick. I am using this code <%= area_chart MediaDownload.select("COUNT(*) as count_all , monthname(created_at) as created_at").group('created_at') %> What I want to achieve is to get a area…
Flezcano
  • 1,647
  • 5
  • 22
  • 39
-1
votes
1 answer

Chartkick displaying numbers instead of dates

I'm trying to display a line chart from a JSON data source, the problem is that my dates are being displayed like small numbers, I don't know why. This is the JSON: [[1341,"2018-01-22 18:00:00"],[1343,"2018-01-22 18:30:00"],[1319,"2018-01-22…
Patricio Sard
  • 2,092
  • 3
  • 22
  • 52
-1
votes
1 answer

'Kickchart gem' show monthly chart by selecting the momth and set by default current month to show

I have this code in my controller filter by month : @posts = Post.by_month(params[:selected_month]) now I need to set current month as default value in case of nil ????
neo7
  • 89
  • 1
  • 10
-1
votes
1 answer

Rails model nested forms, how to create foreign key in 2 models

I am trying to do a webpage for my project at school where a user can list out the stocks that he or she has and can check the weekly prices ( I know, not the best frequency of updates) I have already managed to get chartkick and charjs to sort of…
DGJH
  • 5
  • 4
-1
votes
1 answer

how can I show yearly chart on buttonclick in rails

By default I show a chart for monthly data in my view using chartkick and highcharts. i have already prepared a hash for showing yearly chart but how can I show show yearly chart on buttonclick. My html:
Kgb
  • 21
  • 5
-1
votes
2 answers

Compound Interest Calculator Not Producing Correct Values

I'm working on creating a compound interest formula with monthly contributions in javascript for populating a chartkick.js graph to show the total amount the principal grows to at the end of each year. Here is the formula I'm following. Compound…
zasman
  • 446
  • 1
  • 8
  • 28
-1
votes
1 answer

apply group on associated attributes ruby on rails by using kickchart to show the geo chart

I need to apply group on associated attributes to apply it on pie_chart which is the method of kick chart so I just need to fetch the associated object attribute like = pie_chart array.group(:user) it returns the user object but I need to apply…
Ali Hassan Mirza
  • 552
  • 11
  • 23
-3
votes
2 answers

manipulate ruby hashes to generate data series

I have hash from code like this below {"Jan 2016"=>4649, "Feb 2016"=>3945, "Mar 2016"=>4870, "Apr 2016"=>4872, "May 2016"=>6494, "Jun 2016"=>4981, "Jul 2016"=>9949, "Aug 2016"=>4842, "Sep 2016"=>5820, "Oct 2016"=>4934, "Nov 2016"=>4136, "Dec…
widjajayd
  • 6,090
  • 4
  • 30
  • 41
1 2 3
24
25