anychart_helpers 0.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +54 -0
- data/VERSION +3 -0
- data/anychart_helpers.gemspec +58 -0
- data/lib/anychart_helpers.rb +5 -0
- data/lib/column_chart_multi_series_with_simple_legend.rb +108 -0
- data/test/helper.rb +10 -0
- data/test/test_anychart_helpers.rb +7 -0
- metadata +86 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 jduarte
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
= anychart_helpers
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Note on Patches/Pull Requests
|
6
|
+
|
7
|
+
* Fork the project.
|
8
|
+
* Make your feature addition or bug fix.
|
9
|
+
* Add tests for it. This is important so I don't break it in a
|
10
|
+
future version unintentionally.
|
11
|
+
* Commit, do not mess with rakefile, version, or history.
|
12
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
+
* Send me a pull request. Bonus points for topic branches.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2010 jduarte. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "anychart_helpers"
|
8
|
+
gem.summary = %Q{AnyChart will build the necessary XML files and some helpers to support some AnyChart charts}
|
9
|
+
gem.description = %Q{AnyChart will build the necessary XML files and some helpers to support some AnyChart charts}
|
10
|
+
gem.email = "jose.fduarte@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/jduarte/anychart_helpers"
|
12
|
+
gem.authors = ["jduarte"]
|
13
|
+
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
14
|
+
gem.add_dependency "nokogiri", ">= 1.4.1"
|
15
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
|
+
end
|
17
|
+
Jeweler::GemcutterTasks.new
|
18
|
+
rescue LoadError
|
19
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'rake/testtask'
|
23
|
+
Rake::TestTask.new(:test) do |test|
|
24
|
+
test.libs << 'lib' << 'test'
|
25
|
+
test.pattern = 'test/**/test_*.rb'
|
26
|
+
test.verbose = true
|
27
|
+
end
|
28
|
+
|
29
|
+
begin
|
30
|
+
require 'rcov/rcovtask'
|
31
|
+
Rcov::RcovTask.new do |test|
|
32
|
+
test.libs << 'test'
|
33
|
+
test.pattern = 'test/**/test_*.rb'
|
34
|
+
test.verbose = true
|
35
|
+
end
|
36
|
+
rescue LoadError
|
37
|
+
task :rcov do
|
38
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
task :test => :check_dependencies
|
43
|
+
|
44
|
+
task :default => :test
|
45
|
+
|
46
|
+
require 'rake/rdoctask'
|
47
|
+
Rake::RDocTask.new do |rdoc|
|
48
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
49
|
+
|
50
|
+
rdoc.rdoc_dir = 'rdoc'
|
51
|
+
rdoc.title = "anychart_helpers #{version}"
|
52
|
+
rdoc.rdoc_files.include('README*')
|
53
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
54
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{anychart_helpers}
|
8
|
+
s.version = "0.0.0.pre1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["jduarte"]
|
12
|
+
s.date = %q{2010-02-17}
|
13
|
+
s.description = %q{AnyChart will build the necessary XML files and some helpers to support some AnyChart charts}
|
14
|
+
s.email = %q{jose.fduarte@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"anychart_helpers.gemspec",
|
27
|
+
"lib/anychart_helpers.rb",
|
28
|
+
"lib/column_chart_multi_series_with_simple_legend.rb",
|
29
|
+
"test/helper.rb",
|
30
|
+
"test/test_anychart_helpers.rb"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/jduarte/anychart_helpers}
|
33
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.3.5}
|
36
|
+
s.summary = %q{AnyChart will build the necessary XML files and some helpers to support some AnyChart charts}
|
37
|
+
s.test_files = [
|
38
|
+
"test/helper.rb",
|
39
|
+
"test/test_anychart_helpers.rb"
|
40
|
+
]
|
41
|
+
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
48
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.1"])
|
49
|
+
else
|
50
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
51
|
+
s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
|
52
|
+
end
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
55
|
+
s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
@@ -0,0 +1,108 @@
|
|
1
|
+
class ColumnChartMultiSeriesWithSimpleLegend
|
2
|
+
def self.xml(options={})
|
3
|
+
require 'nokogiri'
|
4
|
+
|
5
|
+
builder = Nokogiri::XML::Builder.new do |xml|
|
6
|
+
xml.anychart {
|
7
|
+
xml.settings {
|
8
|
+
xml.animation(:enabled=>"True")
|
9
|
+
}
|
10
|
+
xml.charts {
|
11
|
+
xml.chart(:plot_type => "CategorizedVertical") {
|
12
|
+
xml.data_plot_settings(:default_series_type => "Bar") {}
|
13
|
+
xml.chart_settings {}
|
14
|
+
xml.data {}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
end
|
19
|
+
builder.to_xml
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
# <anychart>
|
25
|
+
# −
|
26
|
+
# <settings>
|
27
|
+
# <animation enabled="True"/>
|
28
|
+
# </settings>
|
29
|
+
# −
|
30
|
+
# <charts>
|
31
|
+
# −
|
32
|
+
# <chart plot_type="CategorizedVertical">
|
33
|
+
# −
|
34
|
+
# <data_plot_settings default_series_type="Bar">
|
35
|
+
# −
|
36
|
+
# <bar_series point_padding="0.2" group_padding="1">
|
37
|
+
# −
|
38
|
+
# <tooltip_settings enabled="True">
|
39
|
+
# <format>{%Name} - {%YValue}</format>
|
40
|
+
# </tooltip_settings>
|
41
|
+
# </bar_series>
|
42
|
+
# </data_plot_settings>
|
43
|
+
# −
|
44
|
+
# <chart_settings>
|
45
|
+
# −
|
46
|
+
# <title enabled="true">
|
47
|
+
# <text>Multi-Series: with Simple Legend</text>
|
48
|
+
# </title>
|
49
|
+
# −
|
50
|
+
# <legend enabled="true" position="Right" align="Near">
|
51
|
+
# <format>{%Icon} {%Name} ({%Value})</format>
|
52
|
+
# <template/>
|
53
|
+
# <title enabled="false"/>
|
54
|
+
# <columns_separator enabled="false"/>
|
55
|
+
# −
|
56
|
+
# <background>
|
57
|
+
# <inside_margin left="10" right="10"/>
|
58
|
+
# </background>
|
59
|
+
# </legend>
|
60
|
+
# −
|
61
|
+
# <axes>
|
62
|
+
# −
|
63
|
+
# <y_axis>
|
64
|
+
# −
|
65
|
+
# <labels>
|
66
|
+
# <format>{%Value}{numDecimals:0}</format>
|
67
|
+
# </labels>
|
68
|
+
# </y_axis>
|
69
|
+
# </axes>
|
70
|
+
# </chart_settings>
|
71
|
+
# −
|
72
|
+
# <data>
|
73
|
+
# −
|
74
|
+
# <series name="Series 1">
|
75
|
+
# <point name="P1" y="12"/>
|
76
|
+
# <point name="P2" y="24"/>
|
77
|
+
# <point name="P3" y="46"/>
|
78
|
+
# <point name="P4" y="52"/>
|
79
|
+
# <point name="P5" y="88"/>
|
80
|
+
# </series>
|
81
|
+
# −
|
82
|
+
# <series name="Series 2">
|
83
|
+
# <point name="P1" y="23"/>
|
84
|
+
# <point name="P2" y="45"/>
|
85
|
+
# <point name="P3" y="46"/>
|
86
|
+
# <point name="P4" y="86"/>
|
87
|
+
# <point name="P5" y="45"/>
|
88
|
+
# </series>
|
89
|
+
# −
|
90
|
+
# <series name="Series 3">
|
91
|
+
# <point name="P1" y="35"/>
|
92
|
+
# <point name="P2" y="76"/>
|
93
|
+
# <point name="P3" y="87"/>
|
94
|
+
# <point name="P4" y="42"/>
|
95
|
+
# <point name="P5" y="17"/>
|
96
|
+
# </series>
|
97
|
+
# −
|
98
|
+
# <series name="Series 4">
|
99
|
+
# <point name="P1" y="33"/>
|
100
|
+
# <point name="P2" y="39"/>
|
101
|
+
# <point name="P3" y="46"/>
|
102
|
+
# <point name="P4" y="69"/>
|
103
|
+
# <point name="P5" y="87"/>
|
104
|
+
# </series>
|
105
|
+
# </data>
|
106
|
+
# </chart>
|
107
|
+
# </charts>
|
108
|
+
# </anychart>
|
data/test/helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: anychart_helpers
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0.pre1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- jduarte
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-02-17 00:00:00 +00:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: thoughtbot-shoulda
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: nokogiri
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.4.1
|
34
|
+
version:
|
35
|
+
description: AnyChart will build the necessary XML files and some helpers to support some AnyChart charts
|
36
|
+
email: jose.fduarte@gmail.com
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- LICENSE
|
43
|
+
- README.rdoc
|
44
|
+
files:
|
45
|
+
- .document
|
46
|
+
- .gitignore
|
47
|
+
- LICENSE
|
48
|
+
- README.rdoc
|
49
|
+
- Rakefile
|
50
|
+
- VERSION
|
51
|
+
- anychart_helpers.gemspec
|
52
|
+
- lib/anychart_helpers.rb
|
53
|
+
- lib/column_chart_multi_series_with_simple_legend.rb
|
54
|
+
- test/helper.rb
|
55
|
+
- test/test_anychart_helpers.rb
|
56
|
+
has_rdoc: true
|
57
|
+
homepage: http://github.com/jduarte/anychart_helpers
|
58
|
+
licenses: []
|
59
|
+
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options:
|
62
|
+
- --charset=UTF-8
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
version:
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.3.1
|
76
|
+
version:
|
77
|
+
requirements: []
|
78
|
+
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 1.3.5
|
81
|
+
signing_key:
|
82
|
+
specification_version: 3
|
83
|
+
summary: AnyChart will build the necessary XML files and some helpers to support some AnyChart charts
|
84
|
+
test_files:
|
85
|
+
- test/helper.rb
|
86
|
+
- test/test_anychart_helpers.rb
|