rgraph-rails 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.travis.yml +1 -0
- data/README.md +5 -5
- data/lib/rgraph-rails/version.rb +1 -1
- data/rgraph-rails.gemspec +2 -2
- data/vendor/assets/images/bg.png +0 -0
- data/vendor/assets/images/bullet.png +0 -0
- data/vendor/assets/images/facebook-large.png +0 -0
- data/vendor/assets/images/google-plus-large.png +0 -0
- data/vendor/assets/images/logo.png +0 -0
- data/vendor/assets/images/meter-image-sd-needle.png +0 -0
- data/vendor/assets/images/meter-image-sd.png +0 -0
- data/vendor/assets/images/meter-sketch-needle.png +0 -0
- data/vendor/assets/images/meter-sketch.png +0 -0
- data/vendor/assets/images/odometer-background.png +0 -0
- data/vendor/assets/images/rgraph.jpg +0 -0
- data/vendor/assets/images/title.png +0 -0
- data/vendor/assets/images/twitter-large.png +0 -0
- data/vendor/assets/javascripts/RGraph.bar.js +258 -30
- data/vendor/assets/javascripts/RGraph.bipolar.js +4 -3
- data/vendor/assets/javascripts/RGraph.common.annotate.js +4 -3
- data/vendor/assets/javascripts/RGraph.common.context.js +4 -3
- data/vendor/assets/javascripts/RGraph.common.core.js +227 -105
- data/vendor/assets/javascripts/RGraph.common.csv.js +4 -3
- data/vendor/assets/javascripts/RGraph.common.deprecated.js +4 -3
- data/vendor/assets/javascripts/RGraph.common.dynamic.js +5 -4
- data/vendor/assets/javascripts/RGraph.common.effects.js +4 -3
- data/vendor/assets/javascripts/RGraph.common.key.js +4 -3
- data/vendor/assets/javascripts/RGraph.common.resizing.js +4 -3
- data/vendor/assets/javascripts/RGraph.common.sheets.js +357 -0
- data/vendor/assets/javascripts/RGraph.common.tooltips.js +6 -4
- data/vendor/assets/javascripts/RGraph.common.zoom.js +4 -3
- data/vendor/assets/javascripts/RGraph.drawing.background.js +4 -3
- data/vendor/assets/javascripts/RGraph.drawing.circle.js +4 -3
- data/vendor/assets/javascripts/RGraph.drawing.image.js +4 -3
- data/vendor/assets/javascripts/RGraph.drawing.marker1.js +4 -3
- data/vendor/assets/javascripts/RGraph.drawing.marker2.js +4 -3
- data/vendor/assets/javascripts/RGraph.drawing.marker3.js +1 -1
- data/vendor/assets/javascripts/RGraph.drawing.poly.js +1 -1
- data/vendor/assets/javascripts/RGraph.drawing.rect.js +1 -1
- data/vendor/assets/javascripts/RGraph.drawing.text.js +1 -1
- data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +1 -1
- data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +33 -30
- data/vendor/assets/javascripts/RGraph.fuel.js +14 -16
- data/vendor/assets/javascripts/RGraph.funnel.js +1 -1
- data/vendor/assets/javascripts/RGraph.gantt.js +1 -1
- data/vendor/assets/javascripts/RGraph.gauge.js +3 -5
- data/vendor/assets/javascripts/RGraph.hbar.js +738 -212
- data/vendor/assets/javascripts/RGraph.hprogress.js +30 -33
- data/vendor/assets/javascripts/RGraph.line.js +246 -31
- data/vendor/assets/javascripts/RGraph.meter.js +72 -36
- data/vendor/assets/javascripts/RGraph.modaldialog.js +1 -1
- data/vendor/assets/javascripts/RGraph.odo.js +3 -5
- data/vendor/assets/javascripts/RGraph.pie.js +23 -15
- data/vendor/assets/javascripts/RGraph.radar.js +1 -1
- data/vendor/assets/javascripts/RGraph.rose.js +2 -2
- data/vendor/assets/javascripts/RGraph.rscatter.js +116 -27
- data/vendor/assets/javascripts/RGraph.scatter.js +14 -15
- data/vendor/assets/javascripts/RGraph.thermometer.js +8 -10
- data/vendor/assets/javascripts/RGraph.vprogress.js +8 -10
- data/vendor/assets/javascripts/RGraph.waterfall.js +1 -1
- data/vendor/assets/stylesheets/website.css +32 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjgxMzVlOTc0MDk3OWJjZjlkOTBkOGQzNTUwYjllODUyZTQ3MmNiNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTcyNDQ3YjczYzE5NTA5ZTNlN2Y2ZjkzODM4Y2RlY2JkNjJhNWU2Mg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGY5YTU0MjExMDQ3ZmIxYzEwOWZkNTI2YmQxMmRjZTZhYWZhMTdkNTc3NTdk
|
10
|
+
MTU0MzkzZjIwOGQ5YmFjMjU4NDkyZGI4NTI1YmVkYWUyNzk4NTQwMjQxYjRl
|
11
|
+
NWQyNTUzMDE1MGFhOWQ0OTljZjRjNGVkMjQ1YTllNzgzYzM4MGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmJlOGY0Zjg0YjQ2ZmU3Y2QzYTk5YjBlNjJmNTg5NjdiNTU4NTMxOGJkMzRi
|
14
|
+
ZjM0MDViNDVlMDBiMmI2MWJlMWY5ZGFiNzFjZGExY2Y1ZTU4ZWRlYTY5NzYw
|
15
|
+
YTZkNDMyZTJiMGI1MGI2ZGQxZmZkMWFlZDc0NzhiZDk5NmVhNDc=
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Use the [rgraph](http://www.rgraph.net/) chart/graph library with the Rails asse
|
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
10
|
-
|
10
|
+
Include the gem in your application's Gemfile:
|
11
11
|
|
12
12
|
```ruby
|
13
13
|
gem 'rgraph-rails', '~> 1.0'
|
@@ -19,18 +19,18 @@ And then execute:
|
|
19
19
|
|
20
20
|
## Usage
|
21
21
|
|
22
|
-
In your application.js
|
22
|
+
In your `application.js`, include the core RGraph file
|
23
23
|
|
24
24
|
```ruby
|
25
25
|
//= require RGraph.common.core
|
26
26
|
```
|
27
27
|
|
28
|
-
Next, include one or more graph types - depending on which one's you'd like to use. For example
|
28
|
+
Next, include one or more graph types - depending on which one's you'd like to use. For example
|
29
29
|
|
30
30
|
```ruby
|
31
31
|
//= require RGraph.hprogress.js
|
32
32
|
```
|
33
|
-
Then you'd add the Graphical data to your `example.coffee`/`example.js
|
33
|
+
Then you'd add the Graphical data to your `example.coffee`/`example.js`
|
34
34
|
|
35
35
|
```coffeescript
|
36
36
|
$(window).load ->
|
@@ -72,5 +72,5 @@ Bug reports and pull requests are welcome. This project is intended to be a safe
|
|
72
72
|
|
73
73
|
## License
|
74
74
|
|
75
|
-
See license.txt
|
75
|
+
See `license.txt`
|
76
76
|
|
data/lib/rgraph-rails/version.rb
CHANGED
data/rgraph-rails.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = RgraphRails::VERSION
|
9
9
|
spec.authors = ["Daniel Griffin"]
|
10
10
|
spec.email = ["danielseangriffin@gmail.com"]
|
11
|
-
spec.licenses = ["GPL"]
|
11
|
+
spec.licenses = ["GPL-3.0"]
|
12
12
|
|
13
13
|
spec.summary = %q{ The rgraph (http://www.rgraph.net/) interactive chart/graph library with the Rails asset pipeline. }
|
14
14
|
spec.description = %q{ The rgraph (http://www.rgraph.net/) interactive chart/graph library with the Rails asset pipeline. }
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "railties", "
|
22
|
+
spec.add_dependency "railties", ">= 4.2"
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.10"
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
25
|
spec.add_development_dependency "rspec", "~> 3.3"
|
data/vendor/assets/images/bg.png
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// version:
|
1
|
+
// version: 2016-02-06
|
2
2
|
/**
|
3
3
|
* o--------------------------------------------------------------------------------o
|
4
4
|
* | This file is part of the RGraph package - you can learn more at: |
|
@@ -7,8 +7,9 @@
|
|
7
7
|
* | |
|
8
8
|
* | RGraph is dual licensed under the Open Source GPL (General Public License) |
|
9
9
|
* | v2.0 license and a commercial license which means that you're not bound by |
|
10
|
-
* | the terms of the GPL. The commercial license
|
11
|
-
* | read about it here:
|
10
|
+
* | the terms of the GPL. The commercial license starts at just �99 (GBP) and |
|
11
|
+
* | you can read about it here: |
|
12
|
+
* | |
|
12
13
|
* | http://www.rgraph.net/license |
|
13
14
|
* o--------------------------------------------------------------------------------o
|
14
15
|
*/
|
@@ -165,6 +166,8 @@
|
|
165
166
|
'chart.grouping': 'grouped',
|
166
167
|
'chart.variant': 'bar',
|
167
168
|
'chart.variant.sketch.verticals': true,
|
169
|
+
'chart.variant.threed.xaxis': true,
|
170
|
+
'chart.variant.threed.yaxis': true,
|
168
171
|
'chart.variant.threed.angle': 0.1,
|
169
172
|
'chart.variant.threed.offsetx': 10,
|
170
173
|
'chart.variant.threed.offsety': 5,
|
@@ -178,6 +181,7 @@
|
|
178
181
|
'chart.tooltips.css.class': 'RGraph_tooltip',
|
179
182
|
'chart.tooltips.event': 'onclick',
|
180
183
|
'chart.tooltips.highlight': true,
|
184
|
+
'chart.tooltips.hotspot.xonly': false,
|
181
185
|
'chart.highlight.stroke': 'rgba(0,0,0,0)',
|
182
186
|
'chart.highlight.fill': 'rgba(255,255,255,0.7)',
|
183
187
|
'chart.key': null,
|
@@ -234,7 +238,15 @@
|
|
234
238
|
'chart.events.click': null,
|
235
239
|
'chart.events.mousemove': null,
|
236
240
|
'chart.numxticks': null,
|
237
|
-
'chart.bevel': false
|
241
|
+
'chart.bevel': false,
|
242
|
+
'chart.errorbars': false,
|
243
|
+
'chart.errorbars.color': 'black',
|
244
|
+
'chart.errorbars.capped': true,
|
245
|
+
'chart.errorbars.capped.width': 14,
|
246
|
+
'chart.errorbars.linewidth': 1,
|
247
|
+
'chart.combinedchart.effect': null,
|
248
|
+
'chart.combinedchart.effect.options': null,
|
249
|
+
'chart.combinedchart.effect.callback': null
|
238
250
|
}
|
239
251
|
|
240
252
|
// Check for support
|
@@ -485,7 +497,8 @@
|
|
485
497
|
// Cache this in a class variable as it's used rather a lot
|
486
498
|
|
487
499
|
/**
|
488
|
-
* Check for tooltips and alert the user that they're not supported
|
500
|
+
* Check for tooltips and alert the user that they're not supported
|
501
|
+
* with pyramid charts
|
489
502
|
*/
|
490
503
|
if ( (prop['chart.variant'] == 'pyramid' || prop['chart.variant'] == 'dot')
|
491
504
|
&& typeof(prop['chart.tooltips']) == 'object'
|
@@ -510,6 +523,8 @@
|
|
510
523
|
this.grapharea = ca.height - this.gutterTop - this.gutterBottom;
|
511
524
|
this.halfgrapharea = this.grapharea / 2;
|
512
525
|
this.halfTextHeight = prop['chart.text.size'] / 2;
|
526
|
+
|
527
|
+
|
513
528
|
|
514
529
|
|
515
530
|
|
@@ -555,6 +570,16 @@
|
|
555
570
|
|
556
571
|
|
557
572
|
|
573
|
+
/**
|
574
|
+
* Draw errorbars
|
575
|
+
*/
|
576
|
+
if (prop['chart.errorbars']) {
|
577
|
+
this.drawErrorbars();
|
578
|
+
}
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
558
583
|
/**
|
559
584
|
* Draw "in graph" labels
|
560
585
|
*/
|
@@ -782,14 +807,16 @@
|
|
782
807
|
*/
|
783
808
|
this.drawbars =
|
784
809
|
this.Drawbars = function ()
|
785
|
-
{
|
810
|
+
{
|
786
811
|
co.lineWidth = prop['chart.linewidth'];
|
787
812
|
co.strokeStyle = prop['chart.strokecolor'];
|
788
813
|
co.fillStyle = prop['chart.colors'][0];
|
789
|
-
|
790
|
-
var
|
791
|
-
|
792
|
-
|
814
|
+
|
815
|
+
var prevX = 0,
|
816
|
+
prevY = 0,
|
817
|
+
decimals = prop['chart.scale.decimals'];
|
818
|
+
|
819
|
+
|
793
820
|
/**
|
794
821
|
* Work out the max value
|
795
822
|
*/
|
@@ -810,17 +837,70 @@
|
|
810
837
|
|
811
838
|
} else {
|
812
839
|
|
840
|
+
|
841
|
+
|
842
|
+
|
843
|
+
|
844
|
+
//
|
845
|
+
// If errorbars are given as a number then convert the nuumber to an
|
846
|
+
// array.
|
847
|
+
//
|
848
|
+
var errorbars = prop['chart.errorbars'];
|
849
|
+
|
850
|
+
if (typeof errorbars === 'number') {
|
851
|
+
|
852
|
+
var value = errorbars;
|
853
|
+
|
854
|
+
prop['chart.errorbars'] = [];
|
855
|
+
|
856
|
+
for (var i=0; i<this.data.length; ++i) {
|
857
|
+
if (typeof this.data[i] === 'number') {
|
858
|
+
prop['chart.errorbars'].push([value, null]);
|
859
|
+
|
860
|
+
} else if (typeof this.data[i] === 'object' && !RG.isNull(this.data[i])) {
|
861
|
+
for (var j=0; j<this.data[i].length; ++j) {
|
862
|
+
prop['chart.errorbars'].push([value, null]);
|
863
|
+
}
|
864
|
+
}
|
865
|
+
}
|
866
|
+
|
867
|
+
errorbars = prop['chart.errorbars'];
|
868
|
+
}
|
869
|
+
|
870
|
+
|
871
|
+
|
872
|
+
|
873
|
+
|
874
|
+
|
875
|
+
|
876
|
+
|
813
877
|
for (i=0; i<this.data.length; ++i) {
|
814
878
|
if (typeof(this.data[i]) == 'object') {
|
815
|
-
var value = prop['chart.grouping']
|
879
|
+
var value = prop['chart.grouping'] === 'grouped' ? Number(RG.arrayMax(this.data[i], true)) : Number(RG.array_sum(this.data[i]));
|
816
880
|
|
817
881
|
} else {
|
818
882
|
var value = Number(this.data[i]);
|
819
883
|
}
|
820
884
|
|
821
|
-
this.max = ma.max(ma.abs(this.max),
|
885
|
+
this.max = ma.max(ma.abs(this.max), ma.abs(value) +
|
886
|
+
|
887
|
+
Number(
|
888
|
+
(
|
889
|
+
typeof prop['chart.errorbars'] === 'object'
|
890
|
+
&& typeof prop['chart.errorbars'][i] === 'object'
|
891
|
+
&& !RG.isNull(prop['chart.errorbars'][i])
|
892
|
+
&& typeof prop['chart.errorbars'][i][0] === 'number'
|
893
|
+
) ? prop['chart.errorbars'][i][0] : 0
|
894
|
+
)
|
895
|
+
);
|
822
896
|
}
|
823
897
|
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
|
902
|
+
|
903
|
+
|
824
904
|
this.scale2 = RGraph.getScale2(this, {
|
825
905
|
'max':this.max,
|
826
906
|
'min':prop['chart.ymin'],
|
@@ -858,7 +938,7 @@
|
|
858
938
|
if (variant === '3d') {
|
859
939
|
RG.draw3DAxes(this);
|
860
940
|
}
|
861
|
-
|
941
|
+
|
862
942
|
/**
|
863
943
|
* Get the variant once, and draw the bars, be they regular, stacked or grouped
|
864
944
|
*/
|
@@ -1052,9 +1132,9 @@
|
|
1052
1132
|
|
1053
1133
|
|
1054
1134
|
|
1055
|
-
// Draw the
|
1135
|
+
// Draw the lighter top section
|
1056
1136
|
co.beginPath();
|
1057
|
-
co.fillStyle = 'rgba(255,255,255,0.
|
1137
|
+
co.fillStyle = 'rgba(255,255,255,0.5)';
|
1058
1138
|
co.moveTo(x + hmargin, y);
|
1059
1139
|
co.lineTo(x + hmargin + prop['chart.variant.threed.offsetx'], y - prop['chart.variant.threed.offsety']);
|
1060
1140
|
co.lineTo(x + hmargin + prop['chart.variant.threed.offsetx'] + barWidth, y - prop['chart.variant.threed.offsety']);
|
@@ -1277,9 +1357,9 @@
|
|
1277
1357
|
co.fill();
|
1278
1358
|
co.stroke();
|
1279
1359
|
|
1280
|
-
// Draw the
|
1360
|
+
// Draw the lighter top side
|
1281
1361
|
if (j == 0) {
|
1282
|
-
co.fillStyle = 'rgba(255,255,255,0.
|
1362
|
+
co.fillStyle = 'rgba(255,255,255,0.5)';
|
1283
1363
|
co.beginPath();
|
1284
1364
|
co.moveTo(startX + hmargin, y);
|
1285
1365
|
co.lineTo(startX + prop['chart.variant.threed.offsetx'] + hmargin, y - prop['chart.variant.threed.offsety']);
|
@@ -1442,7 +1522,7 @@
|
|
1442
1522
|
|
1443
1523
|
// Draw the lighter top side - but only if the current value is positive
|
1444
1524
|
if (this.data[i][j] >= 0) {
|
1445
|
-
co.fillStyle = 'rgba(255,255,255,0.
|
1525
|
+
co.fillStyle = 'rgba(255,255,255,0.5)';
|
1446
1526
|
co.beginPath();
|
1447
1527
|
// BL
|
1448
1528
|
co.moveTo(startX + hmarginGrouped, startY);
|
@@ -1554,8 +1634,8 @@
|
|
1554
1634
|
{
|
1555
1635
|
var context = co;
|
1556
1636
|
|
1557
|
-
var text_angle = prop['chart.text.angle']
|
1558
|
-
text_size = prop['chart.text.size']
|
1637
|
+
var text_angle = prop['chart.text.angle'],
|
1638
|
+
text_size = prop['chart.text.size'],
|
1559
1639
|
labels = prop['chart.labels']
|
1560
1640
|
|
1561
1641
|
|
@@ -2046,7 +2126,11 @@
|
|
2046
2126
|
|
2047
2127
|
// Recreate the path/rectangle so that it can be tested
|
2048
2128
|
// ** DO NOT STROKE OR FILL IT **
|
2049
|
-
|
2129
|
+
if (prop['chart.tooltips.hotspot.xonly']) {
|
2130
|
+
pa(co,['b','r',left,this.gutterTop,width,ca.height - this.gutterBottom]);
|
2131
|
+
} else {
|
2132
|
+
pa(co,['b','r',left,top,width,height]);
|
2133
|
+
}
|
2050
2134
|
|
2051
2135
|
if (co.isPointInPath(mouseX, mouseY)) {
|
2052
2136
|
|
@@ -2214,9 +2298,9 @@
|
|
2214
2298
|
return null;
|
2215
2299
|
}
|
2216
2300
|
|
2217
|
-
var co = this.context
|
2218
|
-
|
2219
|
-
|
2301
|
+
var co = this.context,
|
2302
|
+
ca = this.canvas,
|
2303
|
+
prop = this.properties;
|
2220
2304
|
|
2221
2305
|
var y;
|
2222
2306
|
var xaxispos = prop['chart.xaxispos'];
|
@@ -3109,6 +3193,139 @@
|
|
3109
3193
|
|
3110
3194
|
|
3111
3195
|
|
3196
|
+
//
|
3197
|
+
// Draws error-bars for the Bar and Line charts
|
3198
|
+
//
|
3199
|
+
this.drawErrorbars = function ()
|
3200
|
+
{
|
3201
|
+
var coords = this.coords,
|
3202
|
+
color = prop['chart.errorbars.color'] || 'black',
|
3203
|
+
default_halfwidth = ma.min(prop['chart.errorbars.capped.width'], coords[0][2]) / 2,
|
3204
|
+
x = 0,
|
3205
|
+
errorbars = prop['chart.errorbars'],
|
3206
|
+
length = 0;
|
3207
|
+
|
3208
|
+
|
3209
|
+
// If not capped set the width of the cqap to zero
|
3210
|
+
if (!prop['chart.errorbars.capped']) {
|
3211
|
+
prop['chart.errorbars.capped.width'] = 0;
|
3212
|
+
halfwidth = 0;
|
3213
|
+
}
|
3214
|
+
|
3215
|
+
// Set the linewidth
|
3216
|
+
co.lineWidth = prop['chart.errorbars.linewidth'];
|
3217
|
+
|
3218
|
+
|
3219
|
+
|
3220
|
+
|
3221
|
+
for (var i=0; i<coords.length; ++i) {
|
3222
|
+
|
3223
|
+
|
3224
|
+
// Default to black
|
3225
|
+
color = prop['chart.errorbars.color'] || 'black';
|
3226
|
+
|
3227
|
+
// Set the perbar linewidth if the fourth option in the array
|
3228
|
+
// is specified
|
3229
|
+
if (errorbars[i] && typeof errorbars[i][3] === 'number') {
|
3230
|
+
co.lineWidth = errorbars[i][3];
|
3231
|
+
}
|
3232
|
+
|
3233
|
+
// Set the halfwidth
|
3234
|
+
var halfwidth = (errorbars[i]&& typeof errorbars[i][4] === 'number') ? errorbars[i][4] / 2 : default_halfwidth;
|
3235
|
+
|
3236
|
+
if (!prop['chart.errorbars.capped']) {
|
3237
|
+
halfwidth = 0;
|
3238
|
+
}
|
3239
|
+
|
3240
|
+
|
3241
|
+
|
3242
|
+
// Calulate the pixel size
|
3243
|
+
if (typeof errorbars[i] === 'number') {
|
3244
|
+
|
3245
|
+
length = ma.abs(this.getYCoord(errorbars[i]) - this.getYCoord(0));
|
3246
|
+
|
3247
|
+
if (length) {
|
3248
|
+
pa2(
|
3249
|
+
co,
|
3250
|
+
'b m % % l % % l % % l % % s %',
|
3251
|
+
coords[i][0] + (coords[i][2] / 2),
|
3252
|
+
coords[i][1],
|
3253
|
+
coords[i][0] + (coords[i][2] / 2),
|
3254
|
+
coords[i][1] - length,
|
3255
|
+
coords[i][0] + (coords[i][2] / 2) - halfwidth,
|
3256
|
+
ma.round(coords[i][1] - length),
|
3257
|
+
coords[i][0] + (coords[i][2] / 2) + halfwidth,
|
3258
|
+
ma.round(coords[i][1] - length),
|
3259
|
+
color
|
3260
|
+
);
|
3261
|
+
}
|
3262
|
+
} else if (typeof errorbars[i] === 'object' && !RG.isNull(errorbars[i])) {
|
3263
|
+
|
3264
|
+
var positiveLength = ma.abs(this.getYCoord(errorbars[i][0]) - this.getYCoord(0));
|
3265
|
+
|
3266
|
+
// Color
|
3267
|
+
if (typeof errorbars[i][1] === 'string') {
|
3268
|
+
color = errorbars[i][1];
|
3269
|
+
|
3270
|
+
} else if (typeof errorbars[i][2] === 'string') {
|
3271
|
+
color = errorbars[i][2];
|
3272
|
+
}
|
3273
|
+
|
3274
|
+
// Cap width
|
3275
|
+
halfwidth = typeof errorbars[i][4] === 'number' ? errorbars[i][4] / 2 : default_halfwidth;
|
3276
|
+
|
3277
|
+
if (!prop['chart.errorbars.capped']) {
|
3278
|
+
halfwidth = 0;
|
3279
|
+
}
|
3280
|
+
|
3281
|
+
if (!RG.isNull(errorbars[i][0])) {
|
3282
|
+
pa2(
|
3283
|
+
co,
|
3284
|
+
'b m % % l % % l % % l % % s %',
|
3285
|
+
coords[i][0] + (coords[i][2] / 2),
|
3286
|
+
coords[i][1],
|
3287
|
+
coords[i][0] + (coords[i][2] / 2),
|
3288
|
+
coords[i][1] - positiveLength,
|
3289
|
+
coords[i][0] + (coords[i][2] / 2) - halfwidth,
|
3290
|
+
ma.round(coords[i][1] - positiveLength),
|
3291
|
+
coords[i][0] + (coords[i][2] / 2) + halfwidth,
|
3292
|
+
ma.round(coords[i][1] - positiveLength),
|
3293
|
+
color
|
3294
|
+
);
|
3295
|
+
}
|
3296
|
+
|
3297
|
+
if (typeof errorbars[i][1] === 'number') {
|
3298
|
+
|
3299
|
+
var negativeLength = ma.abs(this.getYCoord(errorbars[i][1]) - this.getYCoord(0));
|
3300
|
+
|
3301
|
+
pa2(
|
3302
|
+
co,
|
3303
|
+
'b m % % l % % l % % l % % s %',
|
3304
|
+
coords[i][0] + (coords[i][2] / 2),
|
3305
|
+
coords[i][1],
|
3306
|
+
coords[i][0] + (coords[i][2] / 2),
|
3307
|
+
coords[i][1] + negativeLength,
|
3308
|
+
coords[i][0] + (coords[i][2] / 2) - halfwidth,
|
3309
|
+
ma.round(coords[i][1] + negativeLength),
|
3310
|
+
coords[i][0] + (coords[i][2] / 2) + halfwidth,
|
3311
|
+
ma.round(coords[i][1] + negativeLength),
|
3312
|
+
color
|
3313
|
+
);
|
3314
|
+
}
|
3315
|
+
}
|
3316
|
+
|
3317
|
+
|
3318
|
+
// Reset the perbar linewidth to the default if the fourth option
|
3319
|
+
// in the array was specified specified
|
3320
|
+
if (errorbars[i] && typeof errorbars[i][3] === 'number') {
|
3321
|
+
co.lineWidth = prop['chart.errorbars.linewidth'];
|
3322
|
+
}
|
3323
|
+
}
|
3324
|
+
};
|
3325
|
+
|
3326
|
+
|
3327
|
+
|
3328
|
+
|
3112
3329
|
/**
|
3113
3330
|
* Register the object
|
3114
3331
|
*/
|
@@ -3165,11 +3382,11 @@
|
|
3165
3382
|
/**
|
3166
3383
|
* Set the Line chart gutters to match the Bar chart gutters
|
3167
3384
|
*/
|
3168
|
-
this.objects[i].
|
3169
|
-
gutterLeft: this.objects[0].get('
|
3170
|
-
gutterRight: this.objects[0].get('
|
3171
|
-
gutterTop: this.objects[0].get('
|
3172
|
-
gutterBottom: this.objects[0].get('
|
3385
|
+
this.objects[i].set({
|
3386
|
+
gutterLeft: this.objects[0].get('gutter.left'), // Needs to use the dot form to skirt an IE9 bug
|
3387
|
+
gutterRight: this.objects[0].get('gutter.right'), // Needs to use the dot form to skirt an IE9 bug
|
3388
|
+
gutterTop: this.objects[0].get('gutter.top'), // Needs to use the dot form to skirt an IE9 bug
|
3389
|
+
gutterBottom: this.objects[0].get('gutter.bottom') // Needs to use the dot form to skirt an IE9 bug
|
3173
3390
|
});
|
3174
3391
|
|
3175
3392
|
if (this.objects[i].type == 'line') {
|
@@ -3241,6 +3458,17 @@
|
|
3241
3458
|
RGraph.CombinedChart.prototype.Draw = function ()
|
3242
3459
|
{
|
3243
3460
|
for (var i=0; i<this.objects.length; ++i) {
|
3244
|
-
this.objects[i].
|
3461
|
+
if (this.objects[i].properties['chart.combinedchart.effect']) {
|
3462
|
+
|
3463
|
+
var options = this.objects[i].properties['chart.combinedchart.effect.options'] ? eval('(' + this.objects[i].properties['chart.combinedchart.effect.options'] + ')') : null;
|
3464
|
+
|
3465
|
+
(this.objects[i][this.objects[i].properties['chart.combinedchart.effect']])
|
3466
|
+
(
|
3467
|
+
options,
|
3468
|
+
this.objects[i].properties['chart.combinedchart.effect.callback']
|
3469
|
+
)
|
3470
|
+
} else {
|
3471
|
+
this.objects[i].draw();
|
3472
|
+
}
|
3245
3473
|
}
|
3246
3474
|
};
|