rchart 1.1.1 → 1.1.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.rdoc +20 -0
- data/VERSION +1 -1
- data/examples/example1.rb +0 -1
- data/examples/example11.rb +0 -1
- data/examples/example13.rb +1 -1
- data/examples/example18.rb +1 -1
- data/examples/example2 +0 -0
- data/examples/example20.rb +0 -1
- data/examples/example3 +0 -0
- data/examples/example5.rb +1 -1
- data/examples/example7 +0 -0
- data/lib/rchart.rb +12 -3
- metadata +46 -25
data/README.rdoc
CHANGED
@@ -18,3 +18,23 @@ This gem requires ruby-gd 0.8.0 dependency.
|
|
18
18
|
== Copyright
|
19
19
|
|
20
20
|
Copyright (c) 2010 amardaxini. See LICENSE for details.
|
21
|
+
|
22
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
23
|
+
a copy of this software and associated documentation files (the
|
24
|
+
"Software"), to deal in the Software without restriction, including
|
25
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
26
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
27
|
+
permit persons to whom the Software is furnished to do so, subject to
|
28
|
+
the following conditions:
|
29
|
+
|
30
|
+
The above copyright notice and this permission notice shall be
|
31
|
+
included in all copies or substantial portions of the Software.
|
32
|
+
|
33
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
34
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
35
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
36
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
37
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
38
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
39
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
40
|
+
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
data/examples/example1.rb
CHANGED
data/examples/example11.rb
CHANGED
@@ -11,7 +11,6 @@ p.set_abscise_label_serie("Serie2")
|
|
11
11
|
ch = Rchart.new(300,200)
|
12
12
|
ch.draw_filled_rounded_rectangle(7,7,293,193,5,240,240,240)
|
13
13
|
ch.draw_rounded_rectangle(5,5,295,195,5,230,230,230)
|
14
|
-
#ch.load_color_palette_from_file("softtones.txt") #OR
|
15
14
|
ch.load_color_palette([[168,188,56],[188,208,76],[208,228,96],[228,245,116],[248,255,136]])
|
16
15
|
ch.draw_filled_circle(122,102,70,200,200,200)
|
17
16
|
ch.set_font_properties("tahoma.ttf",8)
|
data/examples/example13.rb
CHANGED
@@ -25,7 +25,7 @@ ch.draw_grid(4,true,230,230,230,50)
|
|
25
25
|
ch.set_font_properties("tahoma.ttf",6)
|
26
26
|
ch.draw_treshold(0,143,55,72,true,true)
|
27
27
|
|
28
|
-
#draw line graph
|
28
|
+
#draw filled line graph
|
29
29
|
p.remove_serie("Serie2")
|
30
30
|
ch.draw_filled_line_graph(p.get_data,p.get_data_description,60,true)
|
31
31
|
|
data/examples/example18.rb
CHANGED
data/examples/example2
ADDED
Binary file
|
data/examples/example20.rb
CHANGED
@@ -25,7 +25,6 @@ ch.draw_scale(p.get_data,p.get_data_description,Rchart::SCALE_NORMAL,213,217,221
|
|
25
25
|
ch.draw_graph_area_gradient(40,40,40,-50)
|
26
26
|
ch.draw_grid(4,true,230,230,230,10)
|
27
27
|
|
28
|
-
# Draw the line chart
|
29
28
|
ch.set_shadow_properties(3,3,0,0,0,30,4)
|
30
29
|
ch.draw_cubic_curve(p.get_data,p.get_data_description)
|
31
30
|
ch.clear_shadow
|
data/examples/example3
ADDED
Binary file
|
data/examples/example5.rb
CHANGED
data/examples/example7
ADDED
Binary file
|
data/lib/rchart.rb
CHANGED
@@ -22,7 +22,7 @@ class Rchart
|
|
22
22
|
ALIGN_BOTTOM_CENTER = 8
|
23
23
|
ALIGN_BOTTOM_RIGHT = 9
|
24
24
|
FONT_PATH = File.expand_path(File.join(File.dirname(__FILE__),"..","fonts"))
|
25
|
-
attr_accessor :antialias_quality
|
25
|
+
attr_accessor :antialias_quality,:picture
|
26
26
|
# This function create a new chart object.
|
27
27
|
# This object will be used during all the steps of the graph creation.
|
28
28
|
# This object will embed all the pChart functions.
|
@@ -3140,8 +3140,17 @@ class Rchart
|
|
3140
3140
|
file = File.new(file_name,"wb")
|
3141
3141
|
@picture.jpeg(file,quality)
|
3142
3142
|
file.close
|
3143
|
-
|
3144
|
-
|
3143
|
+
end
|
3144
|
+
|
3145
|
+
#Outputs the image in PNG format as String object.
|
3146
|
+
#This method will be especially useful when you want to transmit an image directly to an user(i.e, without first writing it to a file)
|
3147
|
+
|
3148
|
+
def render_png_str(img=self.picture)
|
3149
|
+
img.pngStr
|
3150
|
+
end
|
3151
|
+
|
3152
|
+
|
3153
|
+
# resize image on passing png,jpeg,or gd image
|
3145
3154
|
# pass file_name/gd image,new_file_name,percentage,or resize width,resize height
|
3146
3155
|
def resize_image(file_name,resize_file_name="test",percentage=0,resized_width=0,resized_height=0)
|
3147
3156
|
image = GD::Image.new_from_png(file_name) rescue ""
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rchart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
- 2
|
10
|
+
version: 1.1.2
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- amardaxini
|
@@ -9,19 +15,25 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-10-25 00:00:00 +05:30
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: ruby-gd
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 63
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 8
|
33
|
+
- 0
|
23
34
|
version: 0.8.0
|
24
|
-
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
25
37
|
description: Ruby port of the slick pChart charting library
|
26
38
|
email: amardaxini@gmail.com
|
27
39
|
executables: []
|
@@ -51,13 +63,16 @@ files:
|
|
51
63
|
- examples/example17.rb
|
52
64
|
- examples/example18.rb
|
53
65
|
- examples/example19.rb
|
66
|
+
- examples/example2
|
54
67
|
- examples/example2.rb
|
55
68
|
- examples/example20.rb
|
56
69
|
- examples/example21.rb
|
70
|
+
- examples/example3
|
57
71
|
- examples/example3.rb
|
58
72
|
- examples/example4.rb
|
59
73
|
- examples/example5.rb
|
60
74
|
- examples/example6.rb
|
75
|
+
- examples/example7
|
61
76
|
- examples/example7.rb
|
62
77
|
- examples/example8.rb
|
63
78
|
- examples/example9.rb
|
@@ -82,45 +97,51 @@ rdoc_options:
|
|
82
97
|
require_paths:
|
83
98
|
- lib
|
84
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
85
101
|
requirements:
|
86
102
|
- - ">="
|
87
103
|
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
105
|
+
segments:
|
106
|
+
- 0
|
88
107
|
version: "0"
|
89
|
-
version:
|
90
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
91
110
|
requirements:
|
92
111
|
- - ">="
|
93
112
|
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
114
|
+
segments:
|
115
|
+
- 0
|
94
116
|
version: "0"
|
95
|
-
version:
|
96
117
|
requirements:
|
97
118
|
- libgd-ruby, libpng-dev, libgd-dev package are required
|
98
119
|
rubyforge_project: rchart
|
99
|
-
rubygems_version: 1.3.
|
120
|
+
rubygems_version: 1.3.7
|
100
121
|
signing_key:
|
101
122
|
specification_version: 3
|
102
123
|
summary: Ruby port of the slick pChart charting library
|
103
124
|
test_files:
|
104
|
-
- test/test_rchart.rb
|
105
125
|
- test/helper.rb
|
106
|
-
-
|
107
|
-
- examples/
|
126
|
+
- test/test_rchart.rb
|
127
|
+
- examples/example21.rb
|
108
128
|
- examples/example17.rb
|
109
|
-
- examples/
|
110
|
-
- examples/example9.rb
|
111
|
-
- examples/example3.rb
|
112
|
-
- examples/example2.rb
|
113
|
-
- examples/example8.rb
|
114
|
-
- examples/example6.rb
|
115
|
-
- examples/example15.rb
|
116
|
-
- examples/example7.rb
|
117
|
-
- examples/example19.rb
|
129
|
+
- examples/example20.rb
|
118
130
|
- examples/example12.rb
|
119
|
-
- examples/
|
120
|
-
- examples/
|
121
|
-
- examples/example10.rb
|
131
|
+
- examples/example2.rb
|
132
|
+
- examples/example18.rb
|
122
133
|
- examples/example1.rb
|
123
|
-
- examples/
|
134
|
+
- examples/example11.rb
|
135
|
+
- examples/example7.rb
|
136
|
+
- examples/example8.rb
|
124
137
|
- examples/example16.rb
|
138
|
+
- examples/example5.rb
|
139
|
+
- examples/example19.rb
|
125
140
|
- examples/example14.rb
|
141
|
+
- examples/example3.rb
|
142
|
+
- examples/example6.rb
|
143
|
+
- examples/example4.rb
|
144
|
+
- examples/example9.rb
|
145
|
+
- examples/example10.rb
|
126
146
|
- examples/example13.rb
|
147
|
+
- examples/example15.rb
|