rchart 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/rchart.rb +43 -43
  3. metadata +10 -32
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 1.2.2
data/lib/rchart.rb CHANGED
@@ -1252,49 +1252,49 @@ class Rchart
1252
1252
  # You must specify the name of the two series that will be used as x and y coordinates and the color id to use.
1253
1253
 
1254
1254
  def draw_xy_plot_graph(data,data_description,y_serie_name,x_serie_name,palette_id=0,big_radius=5,small_radius=2,r2=-1,g2=-1,b2=-1,shadow=true)
1255
- r = @palette[palette_id]["r"];
1256
- g = @palette[palette_id]["g"];
1257
- b = @palette[palette_id]["b"];
1258
- r3 = -1
1259
- g3 = -1
1260
- b3 = -1
1261
-
1262
- y_last = -1
1263
- x_last = -1
1264
- data.each do |key|
1265
- if (!key[y_serie_name].nil? && !key[x_serie_name])
1266
- x = key[x_serie_name]
1267
- y = key[y_serie_name]
1268
- y = @g_area_y2 - ((y-@vmin) * @division_ratio)
1269
- x = @g_area_x1 + ((x-@v_x_min) * @x_division_ratio)
1270
- if ( shadow )
1271
- if ( r3 !=-1 && g3 !=-1 && b3 !=-1 )
1272
- self.draw_filled_circle(x+2,y+2,big_radius,r3,g3,b3)
1273
- else
1274
- r3 = @palette[palette_id]["r"]-20
1275
- r = 0 if ( r < 0 )
1276
- g3 = @palette[palette_id]["g"]-20
1277
- g = 0 if ( g < 0 )
1278
- b3 = @palette[palette_id]["b"]-20
1279
- b = 0 if ( b < 0 )
1280
- self.draw_filled_circle(x+2,y+2,big_radius,r3,g3,b3)
1281
- end
1282
- end
1283
- self.draw_filled_circle(x+1,y+1,big_radius,r,g,b);
1284
-
1285
- if ( r2 !=-1 && g2 !=-1 && b2 !=-1 )
1286
- self.draw_filled_circle(x+1,y+1,small_radius,r2,g2,b2)
1287
- else
1288
- r2 = @palette[palette_id]["r"]+20
1289
- r = 255 if ( r > 255 )
1290
- g2 = @palette[palette_id]["g"]+20
1291
- g = 255 if ( g > 255 )
1292
- b2 = @palette[palette_id]["b"]+20
1293
- b = 255 if ( b > 255 )
1294
- self.draw_filled_circle(x+1,y+1,small_radius,r2,g2,b2);
1295
- end
1296
- end
1297
- end
1255
+ r = @palette[palette_id]["r"]
1256
+ g = @palette[palette_id]["g"]
1257
+ b = @palette[palette_id]["b"]
1258
+ r3 = -1
1259
+ g3 = -1
1260
+ b3 = -1
1261
+
1262
+ y_last = -1
1263
+ x_last = -1
1264
+ data.each do |key|
1265
+ next if (key[y_serie_name].nil? or key[x_serie_name].nil?)
1266
+
1267
+ x = key[x_serie_name]
1268
+ y = key[y_serie_name]
1269
+ y = @g_area_y2 - ((y-@vmin) * @division_ratio)
1270
+ x = @g_area_x1 + ((x-@v_x_min) * @x_division_ratio)
1271
+ if ( shadow )
1272
+ if ( r3 !=-1 && g3 !=-1 && b3 !=-1 )
1273
+ self.draw_filled_circle(x+2,y+2,big_radius,r3,g3,b3)
1274
+ else
1275
+ r3 = @palette[palette_id]["r"]-20
1276
+ r = 0 if ( r < 0 )
1277
+ g3 = @palette[palette_id]["g"]-20
1278
+ g = 0 if ( g < 0 )
1279
+ b3 = @palette[palette_id]["b"]-20
1280
+ b = 0 if ( b < 0 )
1281
+ draw_filled_circle(x+2,y+2,big_radius,r3,g3,b3)
1282
+ end
1283
+ end
1284
+ draw_filled_circle(x+1,y+1,big_radius,r,g,b)
1285
+
1286
+ if ( r2 !=-1 && g2 !=-1 && b2 !=-1 )
1287
+ draw_filled_circle(x+1,y+1,small_radius,r2,g2,b2)
1288
+ else
1289
+ r2 = @palette[palette_id]["r"]+20
1290
+ r = 255 if ( r > 255 )
1291
+ g2 = @palette[palette_id]["g"]+20
1292
+ g = 255 if ( g > 255 )
1293
+ b2 = @palette[palette_id]["b"]+20
1294
+ b = 255 if ( b > 255 )
1295
+ draw_filled_circle(x+1,y+1,small_radius,r2,g2,b2)
1296
+ end
1297
+ end
1298
1298
  end
1299
1299
 
1300
1300
  # This function will draw an area between two data series.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rchart
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease: false
4
+ hash: 27
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 1
10
- version: 1.2.1
9
+ - 2
10
+ version: 1.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - amardaxini
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-09 00:00:00 +05:30
18
+ date: 2011-12-22 00:00:00 +05:30
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -89,8 +89,8 @@ homepage: http://github.com/amardaxini/rchart
89
89
  licenses: []
90
90
 
91
91
  post_install_message:
92
- rdoc_options:
93
- - --charset=UTF-8
92
+ rdoc_options: []
93
+
94
94
  require_paths:
95
95
  - lib
96
96
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -114,31 +114,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - libgd-ruby, libpng-dev, libgd-dev package are required
116
116
  rubyforge_project: rchart
117
- rubygems_version: 1.3.7
117
+ rubygems_version: 1.4.2
118
118
  signing_key:
119
119
  specification_version: 3
120
120
  summary: Ruby port of the slick pChart charting library
121
- test_files:
122
- - test/helper.rb
123
- - test/test_rchart.rb
124
- - examples/example21.rb
125
- - examples/example17.rb
126
- - examples/example20.rb
127
- - examples/example12.rb
128
- - examples/example2.rb
129
- - examples/example18.rb
130
- - examples/example1.rb
131
- - examples/example11.rb
132
- - examples/example7.rb
133
- - examples/example8.rb
134
- - examples/example16.rb
135
- - examples/example5.rb
136
- - examples/example19.rb
137
- - examples/example14.rb
138
- - examples/example3.rb
139
- - examples/example6.rb
140
- - examples/example4.rb
141
- - examples/example9.rb
142
- - examples/example10.rb
143
- - examples/example13.rb
144
- - examples/example15.rb
121
+ test_files: []
122
+