plot_simple 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,24 +1,9 @@
1
1
  # PlotSimple
2
2
  PlotSimple is an engine for javascript graphs using HTML 5 and jqPlot.
3
3
 
4
- ## Installation
5
-
6
- ### Command Line
7
-
8
- `gem install plot_simple`
9
-
10
- ### Bundler (Gemfile)
11
-
12
- `"plot_simple","~>0.0.0"`
13
-
14
- * Make sure that your application.js has jqplot...possibly may add it later.
15
-
16
- ##Charts
17
-
18
- PlotSimple is able to handle the following charts at this current time:
19
-
20
- * Column
4
+ # How to Use
21
5
 
6
+ See PlotSimpleDocumentation.pdf in this repo.
22
7
  ##HELP!
23
8
 
24
9
  Help can be obtained using [Helpsheets.co](https://www.helpsheets.co) or [StackOverflow](http://stackoverflow.com)
@@ -0,0 +1,12 @@
1
+ require "rails/generators"
2
+ module PlotSimple
3
+ class JqplotthemesGenerator < Rails::Generators::Base
4
+ desc "A theme generator for jqplot"
5
+
6
+ def generate_jqplotthemes
7
+ source_root = File.expand_path("../../../../app/views/plot_simple/",__FILE__)
8
+ FileUtils.copy_entry source_root, "app/views/plot_simple/"
9
+ end
10
+
11
+ end
12
+ end
@@ -1,9 +1,10 @@
1
1
  module PlotSimple
2
2
  require 'engine' if defined?(Rails)
3
+ require 'generators/plot_simple/jqplotthemes_generator'
3
4
  module Charts
4
5
  #This will be a bump to 1.0.0...inserting objects
5
6
  class BarChart
6
- attr_accessor :type, :title, :backgroundImage, :background_color, :borderColor, :lineColor, :width, :height, :categories, :pointLabels, :seriesColors
7
+ attr_accessor :type, :title, :backgroundImage, :background_color, :borderColor, :lineColor, :width, :height, :categories, :pointLabels, :seriesColors, :template
7
8
  def initialize
8
9
  @type = "bar"
9
10
  #just so that this can be an object
@@ -54,6 +55,10 @@ module PlotSimple
54
55
  @seriesColors
55
56
  end
56
57
 
58
+ def setTemplate(template)
59
+ @template = template
60
+ end
61
+
57
62
  end
58
63
 
59
64
  class PieChart < BarChart
@@ -84,7 +89,10 @@ module PlotSimple
84
89
 
85
90
  def chartToXML(chart = nil)
86
91
  chart ||= @chart
87
- if chart.type == "bar"
92
+ if !chart.template.nil?
93
+ template = "/plot_simple/"+chart.template
94
+ render :partial=>template,:locals=>{:chart=>chart}
95
+ elsif chart.type == "bar"
88
96
  render :partial=>"plot_simple/barchartxml",:locals=>{:chart=>chart}
89
97
  elsif chart.type == "pie"
90
98
  render :partial=>"plot_simple/piechartxml",:locals=>{:chart=>chart}
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{plot_simple}
3
- s.version = "1.0.1"
3
+ s.version = "1.0.2"
4
4
 
5
5
  s.required_ruby_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = %q{Travis Pessetto}
@@ -9,14 +9,14 @@ Gem::Specification.new do |s|
9
9
  s.email = %q{travis.pessetto@es3inc.com}
10
10
  s.extra_rdoc_files = [%q{README.md}, %q{lib/plot_simple.rb}]
11
11
  s.files = [%q{README.md}, %q{lib/plot_simple.rb},%q{lib/engine.rb}, %q{plot_simple.gemspec}, %q{app/views/plot_simple/_barchartxml.xml.erb},%q{app/views/plot_simple/_piechartxml.xml.erb},
12
- %q{app/views/plot_simple/_stackedcolumnxml.xml.erb}]
12
+ %q{app/views/plot_simple/_stackedcolumnxml.xml.erb},%q{lib/generators/plot_simple/jqplotthemes_generator.rb}]
13
13
  s.homepage = %q{http://www.es3inc.com}
14
14
  s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{plot_simple}, %q{--main}, %q{readme.rdoc}]
15
15
  s.require_paths = [%q{lib}]
16
16
  s.rubyforge_project = %q{plot_simple}
17
17
  s.rubygems_version = %q{1.8.6}
18
18
  s.summary = %q{A gem to simplify the creation of charts from the controller}
19
- s.add_dependency('jquery_cheats', '>= 4.2.0')
19
+ s.add_dependency('jquery_cheats', '>= 5.1.3')
20
20
 
21
21
  if s.respond_to? :specification_version then
22
22
  s.specification_version = 3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plot_simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-31 00:00:00.000000000 Z
12
+ date: 2012-11-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery_cheats
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 4.2.0
21
+ version: 5.1.3
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 4.2.0
29
+ version: 5.1.3
30
30
  description: A graphing engine for jqplot
31
31
  email: travis.pessetto@es3inc.com
32
32
  executables: []
@@ -42,6 +42,7 @@ files:
42
42
  - app/views/plot_simple/_barchartxml.xml.erb
43
43
  - app/views/plot_simple/_piechartxml.xml.erb
44
44
  - app/views/plot_simple/_stackedcolumnxml.xml.erb
45
+ - lib/generators/plot_simple/jqplotthemes_generator.rb
45
46
  homepage: http://www.es3inc.com
46
47
  licenses: []
47
48
  post_install_message: