Questions tagged [gruff]

Gruff is a graphing/infographics library for Ruby that can be used as a standalone gem or as part of Rails.

Gruff is a graphing/infographics library for Ruby that can be used as a standalone gem or as part of Rails. It programmatically creates image files that can be re-used or dynamically generated.

31 questions
1
vote
1 answer

Dynamic image creation using gruff in ruby on rails

I am new to Ruby on Rails and working on Graph creation using 'Gruff'. In controller I am writing below code to create image in assets/images. g.write("#{Rails.root}/app/assets/images/chart/chart.png") and in view : <%=…
1
vote
2 answers

Vertical lines (markers) on ruby gruff x,y chart?

Is it possible in gruff to draw vertical marker lines, or does it only do horizontal lines? If the latter, is there another ruby graph gem that can draw proper x,y graphs?
dcnicholls
  • 391
  • 1
  • 5
  • 15
1
vote
1 answer

Gruff Non-conforming drawing primitive

I have a Ruby script I've written using Gruff to produce graphs. These are simple bar charts, and they've worked fine many times. Now, for one particular set of points I'm getting c:/ruby/lib/ruby/gems/1.8/gems/gruff-0.3.6/lib/gruff/line.rb:109:in…
Mike Cargal
  • 6,610
  • 3
  • 21
  • 27
0
votes
1 answer

Gruff Bar Graph Data in array,

I need a Bar Graph in Gruff with two Bars. For two subjects, I loop through to get the values for activity and grade : sub = ["English", "Maths"] activity = [] grade = [] sub.each do |sub| activity.push(sub["activity"].to_i) …
verdure
  • 3,201
  • 6
  • 26
  • 27
0
votes
1 answer

Stacked Bar - Gruff Graph

I need to generate a Stacked Bar Graph using Gruff. I have tried with the following code: require 'rubygems' require 'gruff' g = Gruff::StackedBar.new('450x450') g.sort = false g.maximum_value = 100 g.minimum_value = 0 g.y_axis_increment =…
verdure
  • 3,201
  • 6
  • 26
  • 27
0
votes
0 answers

use_data_label deprecated in gruff

I'm using gruff to generate side bar graphs on a ruby program, everything was ok, I use the instance method use_data_label = true to show the label for each bar on the y axis. Now that method is deprecated and no longer works, but the documentation…
rtmex
  • 1
  • 3
0
votes
1 answer

Serving dynamically generated images in Rails 6.1

My application dynamically generates images using the gruff gem and then serves these images. The images are stored in app/assets/images/gruff. The images are altered during runtime (keeping the same filename but altering their contents), since…
0
votes
0 answers

Error while installing gruff gem in windows8

I got an error while I installing gem gruff > C:\DevKit>gem install gruff --source http://rubygems.org > --platform=ruby Building native extensions. This could take a while... ERROR: Error installing gruff: > ERROR: Failed to build gem…
NMKP
  • 789
  • 3
  • 11
  • 33
0
votes
1 answer

RoR: Pushing to production and can't access image

Ruby on rails app that creates a dynamic image only shows on development but not on production. Here is the controller: def show require 'gruff' g = Gruff::Pie.new g.title = "Percentages of Fees" g.data 'Management Fees', mf_percent g.data…
Cameron Aziz
  • 487
  • 1
  • 4
  • 24
0
votes
1 answer

How to render row image date without using send_data?

I am using gruff to create an image. I have created an image and now I have a raw image data. I don't want to use gruff.write('image.png') as I want the application to be fast. I want t be able to display that raw image data on the view. But the…
Aleks
  • 4,866
  • 3
  • 38
  • 69
0
votes
2 answers

Generate pie chart with Gruff gem in Ruby

I am attempting to create a pie chart using the gruff gem, but my chart is a black abyss regardless of what I do. This is my code: association_disposition_pie_chart = Gruff::Pie.new association_disposition_pie_chart.title = "Visual Pie Graph…
Luigi
  • 5,443
  • 15
  • 54
  • 108
0
votes
2 answers

Write actual values to bar chart using Gruff within Ruby

I am generating a bar chart with values [1,5,10,23]. Currently, I have no way of knowing those exact values when looking at the image generated by Gruff. I just know that 23 falls somewhere between the lines of 20 and 25. Is it possible to write the…
Luigi
  • 5,443
  • 15
  • 54
  • 108
0
votes
1 answer

Visualize an OWL file with Gruff

How can I load an OWL file in Gruff? It's not clear in the tutorials. I have a file, camera.owl. I need to display this in Gruff and view a graph of it.
0
votes
1 answer

Cannot load Rails application with gruff gem

I am trying to load a Ruby on Rails application that uses the Gruff gem. I can load Gruff fine in irb, but whenever I try to load the app (via ruby script/server), it crashes. Here's the full stack…
mipadi
  • 398,885
  • 90
  • 523
  • 479
0
votes
2 answers

create a image then show in the page not working in ruby on rails

I use "Gruff" to draw a graph for my database table the last step of this function is to create a image in the folder bar_chart.write("/home/lawyer/Capistrano/current/app/assets/images/graph/lawfirm_#{@lawyer.id}.png") and in the show page :it will…
mewosic
  • 465
  • 2
  • 7
  • 11