GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: sample rails app and plugin for open flash chart 2 (alpha 7)
Clone URL: git://github.com/korin/open_flash_chart_2.git
add a example of inline chart
korin (author)
Sat Aug 23 13:04:16 -0700 2008
commit  8a4093cbaf764070554181de675823a01608e22c
tree    f36d9928f8de50324665ca72f93afd2e17485d7f
parent  66209fca80cd800623361bdc200dd16a4955788f
...
1
2
3
4
 
5
6
7
...
29
30
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
33
...
1
2
3
 
4
5
6
7
...
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
0
@@ -1,7 +1,7 @@
0
 class ChartExamplesController < ApplicationController
0
   before_filter :render_chart
0
   def render_chart
0
- unless action_name.eql?('index')
0
+ unless action_name.eql?('index') or action_name =~/^inline_.*/
0
       @graph = "<div>
0
           #{ofc2(650,300, "charts_ofc2/#{action_name}")}
0
         </div>
0
@@ -29,5 +29,29 @@ class ChartExamplesController < ApplicationController
0
   end
0
   def index
0
   end
0
+ def inline_line
0
+ title = OFC2::Title.new( DateTime.now.strftime('%Y-%m-%d %H:%M'), "{font-size: 14px; color: #b50F0F; text-align: center;}")
0
+ line_dot = OFC2::Line.new
0
+ line_dot.values= [9,8,7,6,5,4,3,2,1]
0
+ chart = OFC2::Graph.new
0
+ chart.title= title
0
+ chart << line_dot
0
+
0
+ @graph = ofc2_inline(650,300,chart,'/','inline_line')
0
+
0
+ @name = action_name.gsub('_',' ')
0
+ @code = "# include js file on site\r"
0
+ @code += "&nbsp;&nbsp;= javascript_include_tag 'swfobject.js'\r\r"
0
+ @code += "# in controller"
0
+ if File.exist?("#{RAILS_ROOT}/public/code/charts_ofc2_inline_controller.rb")
0
+ File.read( "#{RAILS_ROOT}/public/code/charts_ofc2_inline_controller.rb" ).scan(/(#{action_name}_begin)(.*)(##{action_name}_end)/m)
0
+ @code += $2.gsub!("\n","\r")
0
+ end
0
+ @code += "\r# display graph in view (haml)\r"
0
+ @code += "&nbsp;&nbsp;=@graph\r"
0
+ @code += "\r# display graph in view (html.erb)\r"
0
+ @code += "&nbsp;&nbsp;<%=@graph%>\r"
0
+ render :action => "show"
0
+ end
0
 end
0
 
...
1
2
3
4
...
 
1
2
3
0
@@ -1,4 +1,3 @@
0
-=# javascript_include_tag 'syntaxHighlight/shBrushXml.js'
0
 = javascript_include_tag 'syntaxHighlight/shBrushChLog.js'
0
 #code_example
0
   %textarea{:name=>"code", :class=>'chlog:nogutter:nocontrols', :cols=>"200", :rows=>"20"}
...
1
 
 
2
3
4
5
 
 
 
 
 
 
...
1
2
3
4
5
 
6
7
8
9
10
11
12
0
@@ -1,4 +1,11 @@
0
 #info_link
0
+ I belive in fair competition.
0
+#info_link
0
   = link_to 'open_flash_chart_lazy', 'http://github.com/peterpunk/open_flash_chart_lazy/tree/master'
0
 #info_description
0
- Other implementation of open flash chart library in ruby.
0
\ No newline at end of file
0
+ Other implementation of open flash chart library in ruby. Maded by peterpunk.
0
+#info_link
0
+ = link_to 'open_flash_chart', 'http://github.com/pullmonkey/open_flash_chart/tree/master'
0
+#info_description
0
+ Other implementation of open flash chart library in ruby. Maded by pullmonkey. Details at
0
+ = link_to 'pullmonkey site.', 'http://www.pullmonkey.com/projects/open_flash_chart2/'
...
9
10
11
12
 
 
13
14
15
...
9
10
11
 
12
13
14
15
16
0
@@ -9,7 +9,8 @@
0
     = stylesheet_link_tag "main"
0
     = stylesheet_link_tag "SyntaxHighlighter"
0
     = javascript_include_tag :defaults
0
- = javascript_include_tag 'swfobject.js'
0
+ = javascript_include_tag 'json2'
0
+ = javascript_include_tag 'swfobject'
0
     = javascript_include_tag 'syntaxHighlight/shCore.js'
0
     = javascript_include_tag 'syntaxHighlight/shBrushRuby.js'
0
   %body
...
10
11
12
13
14
15
16
17
...
10
11
12
 
 
13
14
15
0
@@ -10,8 +10,6 @@
0
     = stylesheet_link_tag "SyntaxHighlighter"
0
     = javascript_include_tag :defaults
0
     = javascript_include_tag 'syntaxHighlight/shCore.js'
0
- =# javascript_include_tag 'syntaxHighlight/shBrushXml.js'
0
- =# javascript_include_tag 'syntaxHighlight/shBrushBash.js'
0
   %body
0
     #site
0
       =render :partial => 'share/main_menu'
...
35
36
37
 
 
 
 
...
35
36
37
38
39
40
41
0
@@ -35,3 +35,7 @@
0
     Scatter
0
   #link
0
     = link_to "Scatter", { :controller=>'chart_examples', :action => "scatter" }
0
+ #link
0
+ Inline charts
0
+ #link
0
+ = link_to "Line", { :controller=>'chart_examples', :action => "inline_line" }
...
 
 
1
2
3
4
5
 
6
7
...
1
2
3
4
5
6
 
7
8
9
0
@@ -1,7 +1,9 @@
0
+debug.client=false
0
+debug.server=true
0
 javac.classpath=
0
 platform.active=Ruby
0
 rails.env=development
0
 rails.port=3000
0
-rails.servertype=MONGREL
0
+rails.servertype=WEBRICK
0
 ruby.includejava=false
0
 source.encoding=UTF-8
...
32
33
34
35
36
37
 
 
 
38
39
40
...
32
33
34
 
 
 
35
36
37
38
39
40
0
@@ -32,9 +32,9 @@ dp.sh.Brushes.Log = function()
0
                     /* banderas */
0
                     {regex: new RegExp('\\s-\\w+', 'g'), css: 'flag'},
0
                     /* headers */
0
- {regex: new RegExp('==[a-zA-Z0-9 ]*==', 'g'), css: 'header'},
0
- {regex: new RegExp('--[a-zA-Z0-9 ]*--', 'g'), css: 'line-through'},
0
- {regex: new RegExp('__[a-zA-Z0-9 ]*__', 'g'), css: 'underline'},
0
+ {regex: new RegExp('==[a-zA-Z0-9 _]*==', 'g'), css: 'header'},
0
+ {regex: new RegExp('--[a-zA-Z0-9 _]*--', 'g'), css: 'line-through'},
0
+ {regex: new RegExp('__[a-zA-Z0-9 _]*__', 'g'), css: 'underline'},
0
                     /* builtins */
0
                     {regex: new RegExp(this.GetKeywords(builtins), 'gm'), css: 'builtin'}
0
                     /* palabras reservadas */
...
1
 
...
 
1
0
@@ -1 +1 @@
0
-Subproject commit 9d3e7752da53a30cd97a1ae65efc6e66ce05f459
0
+Subproject commit a983aa5812c0939b7f16e3ecad1042001e4ff837

Comments

    No one has commented yet.