Git Product home page Git Product logo

open_flash_chart's Introduction

OpenFlashChart  Version 2.0.0  11/14/2008 
==============

1) rails ofc2_test_app
2) cd ofc2_test_app
3) script/plugin install git://github.com/pullmonkey/open_flash_chart.git
3.1) If the install didn't copy the contents of the assets directory to your RAILS_ROOT/public directory, make sure to do so.
4) script/generate controller test_it

5) Add the following to the test_it_controller.rb in RAILS_ROOT/app/controllers:
class TestItController < ApplicationController
  
  def index
    respond_to do |wants|
      wants.html {
        @graph = open_flash_chart_object( 600, 300, url_for( :action => 'index', :format => :json ) )
      }
      wants.json { 
        chart = OpenFlashChart.new( "MY TITLE" ) do |c|
          c << BarGlass.new( :values => (1..10).sort_by{rand} )
        end
        render :text => chart, :layout => false
      }
    end
  end

end

6) Add the following to index.html.erb in RAILS_ROOT/app/views/test_it/:
<html>
<head>
  <script type="text/javascript" src="/javascripts/swfobject.js"></script>
</head>
<body>
<%= @graph %>
</body>
</html>

7) script/server
8) Let me know how it goes, thanks.


Example
=======

Example above and more to follow here - http://www.pullmonkey.com/projects/open_flash_chart

Notes
======
The plugin breaks if the json gem is included, because of the way that the gem generates json vs the rails native json generator.

Not tested, but klochner claims to have implemented a fix for it here - http://github.com/klochner/open_flash_chart/commit/00cf531387880af8c49ed5118737f0492b437f75

Copyright (c) 2008 PullMonkey, released under the MIT license

open_flash_chart's People

Contributors

coryondrejka avatar dennis avatar dfl avatar harryseldon avatar jej avatar johnf avatar niciliketo avatar otavio avatar pullmonkey avatar sunkencity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

open_flash_chart's Issues

How to set dot style?

This should be really easy but I can't figure it out.

In the open flash chart documentation there is a function "set_default_dot_style"

I have some ruby code, but what do I pass to set_default_dot_style?

  line = ScatterLine.new "#000000", 3
  line.set_default_dot_style ???
  chart.add_element line

Thanks for creating this great plugin!

set_lables goes in reverse order

I am creating a horizontal bar graph and setting the values - here is my pseudocode
loop...
b.append_value(v)
labels << lable corresponding to value v
end loop

After all the values are built, I want to set custom labels for the Y axis.
y.set_labels( labels )

The labels show up in reverse order to the values I set. So I have to set labels like this...
y.set_labels( labels.reverse )

Possibly this is a bug?

Rails 3

Heads up: If you want the graph to display in Rails 3.0, your template must use <%= @graph.html_safe %>

Update readme documentation

Hi, great job.

You should add to readme that is you need to copy the contents of the 'assets' folder of the plugin to the 'public' folder of redmine, this way will be very easy to deploy your plugin.

Thanks

how to change background color?

Hi,

Thanks a ton for this wonderful plugin.

How do we change the default background color :(
I see PHP example on ofc site but did not find any method here.

Also, I am comfirtable referring to rdocs. Why we don't have rdoc for ofc.

Ninad

Issue with Bar3d

The following json should show two 3d bars (Energy and Water Efficient) with values 253, 400 and 48, 400. But I see two bars labelled (Energey and Water Efficieny, which is correct), with values 253,48 and 400,400.

Is my assumption correct or is this json being rendered incorrectly?

{"title":{"text":"Eco points by category"},"colours":"#38E081","elements":[{"text":"Energy","colours":"#38E081","font-size":3,"type":"bar_3d","values":[253,400],"grid-colour":"#000000"},{"text":"Water Efficieny","colours":"#38E081","font-size":3,"type":"bar_3d","values":[48,400],"grid-colour":"#000000"}],"y_axis":{"steps":100,"max":500,"min":0},"grid-colour":"#000000","bg_colour":"#ffffff","x_axis":{"labels":{"labels":["Energy","Water Efficieny"]}}}

Horizontal Bar Graph Tooltips

Hi - this is a fantastic plugin!

I am having a problem with horizontal bar graphs. If I set all starting values to zero, the mouseover tooltip gets confused and jumps around oddly. If I stack all of the bar values so there are no overlaps, the mouseover works fine. I think this is a bug in the SWF maybe?

thanks!

Can't set y label color

YAxis labels seem to be pretty buggy in general.. but specifically:

I can't figure out how to get even simple labels (step) to work on the y-axis with a color other than #FFFFFF. My graphs are using black as the background color, so the labels just won't show up.

I've tried hacking it in several different ways but with no positive result. Some help would be appreciated!

how to set label unix dates

Hello,
I found this http://teethgrinder.co.uk/open-flash-chart-2/x-axis-date.php
instructions for using dates for labels, but don't know how to do this with the rails plugin
x = XAxis.new
x.set_labels( ["a", "b"])
and the result is strangely (includes labels twice)
..
"x_axis":{"labels":{"labels":["a","b"]}},
..

x.set_labels expects an array of label strings, not sure how to set the label text format to #date:l jS, M Y#

Do you have an example on a line chart with dates for x axis from unix dates?

thank you !

How to use in rails 4

Hi,
I doing code migration to rails 4, In older code we have used open_flash_chart plugin.
But I tried to use it rails 4.In rails everything mark to gem.I tried to install as gem but it shows the following
Could not find gem 'open_flash_chart' in https://github.com/pullmonkey/open_flash_chart (at master@8f0b61a).
Source does not contain any versions of 'open_flash_chart'

Kindly help me resolve this issue.

Pb with LineDot and LineHollow

I'm trying to render the multiple lines example but the only line I'm seeing is the "Line.new".
LineDot and LineHollow can't be seen.

Is there any way to make it possible?

problem with scatter - hidden points

Hello,
I experienced a problem with scatter points. If the mouse is on the plot the dots appear, but they suddenly disappear if the mouse goes out.
If the mouse is out nothing appear at all.
If I go on the supposed point location the point comes out with the correct label.
I tried with all sfw files I could download, from both this repository and teethgrinder) and I tried all combination of tips, no tips, and kind of data.
I also copied and pasted the example code and it behaves not like in your example page, but like my disappearing ones.
Any suggestions?
Thanks a lot
Gianluca

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.