smart_chart 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.rdoc +187 -0
- data/Rakefile +56 -0
- data/lib/smart_chart/base_chart.rb +428 -0
- data/lib/smart_chart/charts/bar.rb +20 -0
- data/lib/smart_chart/charts/line.rb +22 -0
- data/lib/smart_chart/charts/map.rb +163 -0
- data/lib/smart_chart/charts/meter.rb +13 -0
- data/lib/smart_chart/charts/pie.rb +32 -0
- data/lib/smart_chart/charts/qr_code.rb +85 -0
- data/lib/smart_chart/charts/radar.rb +14 -0
- data/lib/smart_chart/charts/scatter.rb +21 -0
- data/lib/smart_chart/charts/venn.rb +13 -0
- data/lib/smart_chart/data_set.rb +15 -0
- data/lib/smart_chart/encoder.rb +226 -0
- data/lib/smart_chart/exceptions.rb +43 -0
- data/lib/smart_chart/features/axis_lines.rb +29 -0
- data/lib/smart_chart/features/grid_lines.rb +47 -0
- data/lib/smart_chart/features/labels.rb +23 -0
- data/lib/smart_chart/multiple_data_set_chart.rb +128 -0
- data/lib/smart_chart/single_data_set_chart.rb +56 -0
- data/lib/smart_chart.rb +30 -0
- data/test/smart_charts_test.rb +400 -0
- data/test/test_helper.rb +42 -0
- metadata +82 -0
data/test/test_helper.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
5
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
6
|
+
require 'smart_chart'
|
7
|
+
|
8
|
+
class Test::Unit::TestCase
|
9
|
+
|
10
|
+
##
|
11
|
+
# Create a valid line graph with default values.
|
12
|
+
#
|
13
|
+
def line_graph(values = {})
|
14
|
+
SmartChart::Line.new({
|
15
|
+
:width => 400,
|
16
|
+
:height => 200,
|
17
|
+
:data => [
|
18
|
+
{
|
19
|
+
:values => [1,2,3],
|
20
|
+
:style => {:color => 'ffccff'}
|
21
|
+
}
|
22
|
+
]
|
23
|
+
}.merge(values))
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# Create a valid map with default values.
|
28
|
+
#
|
29
|
+
def map_chart(values = {})
|
30
|
+
SmartChart::Map.new({
|
31
|
+
:width => 400,
|
32
|
+
:height => 200,
|
33
|
+
:region => :world,
|
34
|
+
:data => {:US => 1, :MX => 2, :CA => 3},
|
35
|
+
:colors => ["CCCCCC", "CC3333"]
|
36
|
+
}.merge(values))
|
37
|
+
end
|
38
|
+
|
39
|
+
def pie_chart(values = {})
|
40
|
+
SmartChart::Pie.new({}.merge(values))
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: smart_chart
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alex Reisner
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-10-29 00:00:00 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Easily create charts and graphs for the web (uses Google Charts).
|
17
|
+
email: alex@alexreisner.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- LICENSE
|
24
|
+
- README.rdoc
|
25
|
+
files:
|
26
|
+
- .document
|
27
|
+
- .gitignore
|
28
|
+
- LICENSE
|
29
|
+
- README.rdoc
|
30
|
+
- Rakefile
|
31
|
+
- lib/smart_chart.rb
|
32
|
+
- lib/smart_chart/base_chart.rb
|
33
|
+
- lib/smart_chart/charts/bar.rb
|
34
|
+
- lib/smart_chart/charts/line.rb
|
35
|
+
- lib/smart_chart/charts/map.rb
|
36
|
+
- lib/smart_chart/charts/meter.rb
|
37
|
+
- lib/smart_chart/charts/pie.rb
|
38
|
+
- lib/smart_chart/charts/qr_code.rb
|
39
|
+
- lib/smart_chart/charts/radar.rb
|
40
|
+
- lib/smart_chart/charts/scatter.rb
|
41
|
+
- lib/smart_chart/charts/venn.rb
|
42
|
+
- lib/smart_chart/data_set.rb
|
43
|
+
- lib/smart_chart/encoder.rb
|
44
|
+
- lib/smart_chart/exceptions.rb
|
45
|
+
- lib/smart_chart/features/axis_lines.rb
|
46
|
+
- lib/smart_chart/features/grid_lines.rb
|
47
|
+
- lib/smart_chart/features/labels.rb
|
48
|
+
- lib/smart_chart/multiple_data_set_chart.rb
|
49
|
+
- lib/smart_chart/single_data_set_chart.rb
|
50
|
+
- test/smart_charts_test.rb
|
51
|
+
- test/test_helper.rb
|
52
|
+
has_rdoc: true
|
53
|
+
homepage: http://github.com/alexreisner/smart_chart
|
54
|
+
licenses: []
|
55
|
+
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options:
|
58
|
+
- --charset=UTF-8
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: "0"
|
66
|
+
version:
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: "0"
|
72
|
+
version:
|
73
|
+
requirements: []
|
74
|
+
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 1.3.5
|
77
|
+
signing_key:
|
78
|
+
specification_version: 3
|
79
|
+
summary: Easily create charts and graphs for the web (uses Google Charts).
|
80
|
+
test_files:
|
81
|
+
- test/smart_charts_test.rb
|
82
|
+
- test/test_helper.rb
|