rgraph-rails 1.0.8 → 4.62

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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/lib/rgraph-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/RGraph.bar.js +16 -8
  5. data/vendor/assets/javascripts/RGraph.bipolar.js +1 -1
  6. data/vendor/assets/javascripts/RGraph.common.annotate.js +1 -1
  7. data/vendor/assets/javascripts/RGraph.common.context.js +1 -1
  8. data/vendor/assets/javascripts/RGraph.common.core.js +84 -7
  9. data/vendor/assets/javascripts/RGraph.common.csv.js +1 -1
  10. data/vendor/assets/javascripts/RGraph.common.deprecated.js +1 -1
  11. data/vendor/assets/javascripts/RGraph.common.dynamic.js +1 -1
  12. data/vendor/assets/javascripts/RGraph.common.effects.js +1 -1
  13. data/vendor/assets/javascripts/RGraph.common.key.js +3 -3
  14. data/vendor/assets/javascripts/RGraph.common.resizing.js +1 -1
  15. data/vendor/assets/javascripts/RGraph.common.sheets.js +1 -1
  16. data/vendor/assets/javascripts/RGraph.common.tooltips.js +1 -1
  17. data/vendor/assets/javascripts/RGraph.common.zoom.js +1 -1
  18. data/vendor/assets/javascripts/RGraph.drawing.background.js +1 -1
  19. data/vendor/assets/javascripts/RGraph.drawing.circle.js +1 -1
  20. data/vendor/assets/javascripts/RGraph.drawing.image.js +1 -1
  21. data/vendor/assets/javascripts/RGraph.drawing.marker1.js +1 -1
  22. data/vendor/assets/javascripts/RGraph.drawing.marker2.js +1 -1
  23. data/vendor/assets/javascripts/RGraph.drawing.marker3.js +1 -1
  24. data/vendor/assets/javascripts/RGraph.drawing.poly.js +1 -1
  25. data/vendor/assets/javascripts/RGraph.drawing.rect.js +1 -1
  26. data/vendor/assets/javascripts/RGraph.drawing.text.js +1 -1
  27. data/vendor/assets/javascripts/RGraph.drawing.xaxis.js +1 -1
  28. data/vendor/assets/javascripts/RGraph.drawing.yaxis.js +1 -1
  29. data/vendor/assets/javascripts/RGraph.fuel.js +1 -1
  30. data/vendor/assets/javascripts/RGraph.funnel.js +1 -1
  31. data/vendor/assets/javascripts/RGraph.gantt.js +1 -1
  32. data/vendor/assets/javascripts/RGraph.gauge.js +1 -1
  33. data/vendor/assets/javascripts/RGraph.hbar.js +228 -2
  34. data/vendor/assets/javascripts/RGraph.hprogress.js +1 -1
  35. data/vendor/assets/javascripts/RGraph.line.js +27 -5
  36. data/vendor/assets/javascripts/RGraph.meter.js +1 -1
  37. data/vendor/assets/javascripts/RGraph.modaldialog.js +1 -1
  38. data/vendor/assets/javascripts/RGraph.odo.js +1 -1
  39. data/vendor/assets/javascripts/RGraph.pie.js +1 -1
  40. data/vendor/assets/javascripts/RGraph.radar.js +1 -1
  41. data/vendor/assets/javascripts/RGraph.rose.js +1 -1
  42. data/vendor/assets/javascripts/RGraph.rscatter.js +1 -1
  43. data/vendor/assets/javascripts/RGraph.scatter.js +161 -34
  44. data/vendor/assets/javascripts/RGraph.semicircularprogress.js +1 -1
  45. data/vendor/assets/javascripts/RGraph.svg.bar.js +772 -103
  46. data/vendor/assets/javascripts/RGraph.svg.common.ajax.js +1 -1
  47. data/vendor/assets/javascripts/RGraph.svg.common.core.js +806 -231
  48. data/vendor/assets/javascripts/RGraph.svg.common.csv.js +1 -1
  49. data/vendor/assets/javascripts/RGraph.svg.common.fx.js +24 -24
  50. data/vendor/assets/javascripts/RGraph.svg.common.key.js +206 -0
  51. data/vendor/assets/javascripts/RGraph.svg.common.sheets.js +1 -1
  52. data/vendor/assets/javascripts/RGraph.svg.common.tooltips.js +63 -22
  53. data/vendor/assets/javascripts/RGraph.svg.hbar.js +351 -91
  54. data/vendor/assets/javascripts/RGraph.svg.line.js +159 -64
  55. data/vendor/assets/javascripts/RGraph.svg.pie.js +402 -51
  56. data/vendor/assets/javascripts/RGraph.svg.radar.js +320 -143
  57. data/vendor/assets/javascripts/RGraph.svg.rose.js +1818 -0
  58. data/vendor/assets/javascripts/RGraph.svg.scatter.js +1262 -0
  59. data/vendor/assets/javascripts/RGraph.svg.semicircularprogress.js +106 -57
  60. data/vendor/assets/javascripts/RGraph.svg.waterfall.js +1253 -0
  61. data/vendor/assets/javascripts/RGraph.thermometer.js +7 -6
  62. data/vendor/assets/javascripts/RGraph.vprogress.js +1 -1
  63. data/vendor/assets/javascripts/RGraph.waterfall.js +1 -1
  64. data/vendor/assets/javascripts/financial-data.js +1067 -0
  65. metadata +8 -5
  66. data/vendor/assets/javascripts/RGraph.cornergauge.js +0 -71
  67. data/vendor/assets/javascripts/RGraph.thermometer.old.js +0 -68
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -894,8 +894,21 @@
894
894
  /**
895
895
  * If the line is filled re-stroke the lines
896
896
  */
897
+ if (prop['chart.outofbounds.clip']) {
898
+ pa2(
899
+ co,
900
+ 'sa b r % % % % cl b',
901
+ 0,
902
+ this.gutterTop,
903
+ ca.width,
904
+ ca.height - this.gutterTop - this.gutterBottom
905
+ );
906
+ }
907
+
908
+
897
909
  if (prop['chart.filled'] && prop['chart.filled.accumulative'] && !prop['chart.curvy']) {
898
-
910
+
911
+
899
912
  for (var i=0; i<this.coords2.length; ++i) {
900
913
 
901
914
  co.beginPath();
@@ -1005,6 +1018,11 @@
1005
1018
 
1006
1019
 
1007
1020
  }
1021
+
1022
+
1023
+ if (prop['chart.outofbounds.clip']) {
1024
+ co.restore();
1025
+ }
1008
1026
  co.restore();
1009
1027
 
1010
1028
  // ???
@@ -1939,7 +1957,7 @@
1939
1957
  lineData[i] *= prop['chart.animation.factor'];
1940
1958
  }
1941
1959
  }
1942
-
1960
+
1943
1961
  var penUp = false;
1944
1962
  var yPos = null;
1945
1963
  var xPos = 0;
@@ -2009,7 +2027,7 @@
2009
2027
 
2010
2028
  // Store the coords in another format, indexed by line number
2011
2029
  this.coords2[index] = lineCoords;
2012
-
2030
+
2013
2031
  /**
2014
2032
  * For IE only: Draw the shadow ourselves as ExCanvas doesn't produce shadows
2015
2033
  */
@@ -2229,7 +2247,7 @@
2229
2247
 
2230
2248
  // Now redraw the lines with the correct line width
2231
2249
  this.SetShadow(index);
2232
- this.RedrawLine(lineCoords, color, linewidth, index);
2250
+ this.redrawLine(lineCoords, color, linewidth, index);
2233
2251
  co.stroke();
2234
2252
  RG.NoShadow(this);
2235
2253
 
@@ -2661,6 +2679,8 @@
2661
2679
  return;
2662
2680
  }
2663
2681
 
2682
+
2683
+
2664
2684
  co.strokeStyle = (typeof(color) == 'object' && color && color.toString().indexOf('CanvasGradient') == -1 ? color[0] : color);
2665
2685
  co.lineWidth = linewidth;
2666
2686
 
@@ -2767,6 +2787,8 @@
2767
2787
  }
2768
2788
  }
2769
2789
  }
2790
+
2791
+
2770
2792
 
2771
2793
  if (prop['chart.dashed'] || prop['chart.dotted']) {
2772
2794
  co.setLineDash([1,0]);
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -1,4 +1,4 @@
1
- // version: 2017-01-02
1
+ // version: 2017-05-08
2
2
  /**
3
3
  * o--------------------------------------------------------------------------------o
4
4
  * | This file is part of the RGraph package - you can learn more at: |
@@ -72,6 +72,22 @@
72
72
  }
73
73
  }
74
74
 
75
+
76
+
77
+
78
+
79
+ // First, if there's only been a single passed to us, convert it to
80
+ // the multiple dataset format
81
+ if (!RGraph.isArray(this.data[0][0])) {
82
+ this.data = [this.data];
83
+ }
84
+
85
+
86
+
87
+
88
+
89
+
90
+
75
91
  // If necessary convert X/Y values passed as strings to numbers
76
92
  for (var i=0,len=this.data.length; i<len; ++i) { // Datasets
77
93
  for (var j=0,len2=this.data[i].length; j<len2; ++j) { // Points
@@ -411,6 +427,7 @@
411
427
 
412
428
 
413
429
 
430
+
414
431
  /**
415
432
  * A simple setter
416
433
  *
@@ -509,6 +526,10 @@
509
526
 
510
527
 
511
528
 
529
+
530
+
531
+
532
+
512
533
  /**
513
534
  * A simple getter
514
535
  *
@@ -535,6 +556,10 @@
535
556
 
536
557
 
537
558
 
559
+
560
+
561
+
562
+
538
563
  /**
539
564
  * The function you call to draw the Scatter chart
540
565
  */
@@ -805,6 +830,10 @@
805
830
 
806
831
 
807
832
 
833
+
834
+
835
+
836
+
808
837
  /**
809
838
  * Draws the axes of the scatter graph
810
839
  */
@@ -914,21 +943,31 @@
914
943
  }
915
944
  }
916
945
  }
917
-
918
-
946
+
947
+
948
+
949
+
950
+
951
+
952
+
953
+
919
954
  /**
920
955
  * Draw the X tickmarks
921
956
  */
922
957
  if (prop['chart.numxticks'] > 0 && prop['chart.xaxis']) {
923
958
 
924
959
  var x = 0,
925
- y = this.getYCoord(prop['chart.ylabels.invert'] ? this.scale2.max : 0) - 3,
960
+ y = this.getYCoord(prop['chart.ylabels.invert'] ? this.scale2.max : (this.scale2.max > 0 && this.scale2.min > 0 ? this.scale2.min : 0) ) - 3,
926
961
  size = 3;
927
-
962
+
928
963
  if (prop['chart.ymin'] === 0 && prop['chart.xaxispos'] === 'bottom') {
929
964
  y += 3;
930
965
  }
931
966
 
967
+ if (this.scale2.max > 0 && this.scale2.min > 0) {
968
+ y += 3;
969
+ }
970
+
932
971
  this.xTickGap = (prop['chart.labels'] && prop['chart.labels'].length) ? ((ca.width - this.gutterLeft - this.gutterRight ) / prop['chart.labels'].length) : (ca.width - this.gutterLeft - this.gutterRight) / 10;
933
972
 
934
973
  /**
@@ -961,17 +1000,14 @@
961
1000
  */
962
1001
  co.lineWidth = 1;
963
1002
  };
964
-
965
-
966
-
967
-
968
-
969
-
970
-
971
-
972
-
973
-
974
-
1003
+
1004
+
1005
+
1006
+
1007
+
1008
+
1009
+
1010
+
975
1011
  /**
976
1012
  * Draws the labels on the scatter graph
977
1013
  */
@@ -1594,20 +1630,14 @@
1594
1630
  }
1595
1631
  }
1596
1632
  };
1597
-
1598
-
1599
-
1600
-
1601
-
1602
-
1603
-
1604
-
1605
-
1606
-
1607
-
1608
-
1609
-
1610
-
1633
+
1634
+
1635
+
1636
+
1637
+
1638
+
1639
+
1640
+
1611
1641
  /**
1612
1642
  * Draws the actual scatter graph marks
1613
1643
  *
@@ -1662,6 +1692,10 @@
1662
1692
 
1663
1693
 
1664
1694
 
1695
+
1696
+
1697
+
1698
+
1665
1699
  /**
1666
1700
  * Draws a single scatter mark
1667
1701
  */
@@ -1973,6 +2007,10 @@
1973
2007
 
1974
2008
 
1975
2009
 
2010
+
2011
+
2012
+
2013
+
1976
2014
  /**
1977
2015
  * Draws an optional line connecting the tick marks.
1978
2016
  *
@@ -2045,6 +2083,10 @@
2045
2083
 
2046
2084
 
2047
2085
 
2086
+
2087
+
2088
+
2089
+
2048
2090
  /**
2049
2091
  * Returns the linewidth
2050
2092
  *
@@ -2072,6 +2114,10 @@
2072
2114
 
2073
2115
 
2074
2116
 
2117
+
2118
+
2119
+
2120
+
2075
2121
  /**
2076
2122
  * Draws vertical bars. Line chart doesn't use a horizontal scale, hence this function
2077
2123
  * is not common
@@ -2111,6 +2157,10 @@
2111
2157
 
2112
2158
 
2113
2159
 
2160
+
2161
+
2162
+
2163
+
2114
2164
  /**
2115
2165
  * Draws in-graph labels.
2116
2166
  *
@@ -2206,6 +2256,10 @@
2206
2256
 
2207
2257
 
2208
2258
 
2259
+
2260
+
2261
+
2262
+
2209
2263
  /**
2210
2264
  * This function makes it much easier to get the (if any) point that is currently being hovered over.
2211
2265
  *
@@ -2283,6 +2337,10 @@
2283
2337
 
2284
2338
 
2285
2339
 
2340
+
2341
+
2342
+
2343
+
2286
2344
  /**
2287
2345
  * Draws the above line labels
2288
2346
  */
@@ -2336,6 +2394,10 @@
2336
2394
 
2337
2395
 
2338
2396
 
2397
+
2398
+
2399
+
2400
+
2339
2401
  /**
2340
2402
  * When you click on the chart, this method can return the Y value at that point. It works for any point on the
2341
2403
  * chart (that is inside the gutters) - not just points within the Bars.
@@ -2405,6 +2467,10 @@
2405
2467
 
2406
2468
 
2407
2469
 
2470
+
2471
+
2472
+
2473
+
2408
2474
  /**
2409
2475
  * When you click on the chart, this method can return the X value at that point.
2410
2476
  *
@@ -2441,6 +2507,10 @@
2441
2507
 
2442
2508
 
2443
2509
 
2510
+
2511
+
2512
+
2513
+
2444
2514
  /**
2445
2515
  * Each object type has its own Highlight() function which highlights the appropriate shape
2446
2516
  *
@@ -2466,6 +2536,10 @@
2466
2536
 
2467
2537
 
2468
2538
 
2539
+
2540
+
2541
+
2542
+
2469
2543
  /**
2470
2544
  * The getObjectByXY() worker method. Don't call this call:
2471
2545
  *
@@ -2491,6 +2565,10 @@
2491
2565
 
2492
2566
 
2493
2567
 
2568
+
2569
+
2570
+
2571
+
2494
2572
  /**
2495
2573
  * This function can be used when the canvas is clicked on (or similar - depending on the event)
2496
2574
  * to retrieve the relevant X coordinate for a particular value.
@@ -2532,6 +2610,10 @@
2532
2610
 
2533
2611
 
2534
2612
 
2613
+
2614
+
2615
+
2616
+
2535
2617
  /**
2536
2618
  * This function positions a tooltip when it is displayed
2537
2619
  *
@@ -2585,6 +2667,10 @@
2585
2667
 
2586
2668
 
2587
2669
 
2670
+
2671
+
2672
+
2673
+
2588
2674
  /**
2589
2675
  * Returns the applicable Y COORDINATE when given a Y value
2590
2676
  *
@@ -2597,7 +2683,7 @@
2597
2683
  if (typeof(value) != 'number') {
2598
2684
  return null;
2599
2685
  }
2600
-
2686
+
2601
2687
  var invert = prop['chart.ylabels.invert'];
2602
2688
  var xaxispos = prop['chart.xaxispos'];
2603
2689
  var graphHeight = ca.height - this.gutterTop - this.gutterBottom;
@@ -2609,7 +2695,7 @@
2609
2695
  if (value > ymax || (prop['chart.xaxispos'] == 'bottom' && value < ymin) || (prop['chart.xaxispos'] == 'center' && ((value > 0 && value < ymin) || (value < 0 && value > (-1 * ymin))))) {
2610
2696
  return null;
2611
2697
  }
2612
-
2698
+
2613
2699
  /**
2614
2700
  * This calculates scale values if the X axis is in the center
2615
2701
  */
@@ -2635,14 +2721,14 @@
2635
2721
  } else {
2636
2722
 
2637
2723
  coord = ((value - ymin) / (ymax - ymin)) * graphHeight;
2638
-
2724
+
2639
2725
  if (invert) {
2640
2726
  coord = graphHeight - coord;
2641
2727
  }
2642
2728
 
2643
2729
  // Invert the coordinate because the Y scale starts at the top
2644
2730
  coord = graphHeight - coord;
2645
-
2731
+
2646
2732
  // And add on the top gutter
2647
2733
  coord = this.gutterTop + coord;
2648
2734
  }
@@ -2655,6 +2741,8 @@
2655
2741
 
2656
2742
 
2657
2743
 
2744
+
2745
+
2658
2746
  /**
2659
2747
  * A helper class that helps facilitatesbubble charts
2660
2748
  */
@@ -2765,6 +2853,9 @@
2765
2853
 
2766
2854
 
2767
2855
 
2856
+
2857
+
2858
+
2768
2859
  /**
2769
2860
  * This allows for easy specification of gradients
2770
2861
  */
@@ -2849,6 +2940,10 @@
2849
2940
 
2850
2941
 
2851
2942
 
2943
+
2944
+
2945
+
2946
+
2852
2947
  /**
2853
2948
  * Use this function to reset the object to the post-constructor state. Eg reset colors if
2854
2949
  * need be etc
@@ -2860,6 +2955,10 @@
2860
2955
 
2861
2956
 
2862
2957
 
2958
+
2959
+
2960
+
2961
+
2863
2962
  /**
2864
2963
  * This parses a single color value for a gradient
2865
2964
  */
@@ -2891,6 +2990,10 @@
2891
2990
 
2892
2991
 
2893
2992
 
2993
+
2994
+
2995
+
2996
+
2894
2997
  /**
2895
2998
  * This function handles highlighting an entire data-series for the interactive
2896
2999
  * key
@@ -2913,6 +3016,10 @@
2913
3016
 
2914
3017
 
2915
3018
 
3019
+
3020
+
3021
+
3022
+
2916
3023
  /**
2917
3024
  * Using a function to add events makes it easier to facilitate method chaining
2918
3025
  *
@@ -2937,6 +3044,10 @@
2937
3044
 
2938
3045
 
2939
3046
 
3047
+
3048
+
3049
+
3050
+
2940
3051
  /**
2941
3052
  * This function runs once only
2942
3053
  * (put at the end of the file (before any effects))
@@ -2948,6 +3059,10 @@
2948
3059
 
2949
3060
 
2950
3061
 
3062
+
3063
+
3064
+
3065
+
2951
3066
  /**
2952
3067
  * Trace2
2953
3068
  *
@@ -2992,6 +3107,10 @@
2992
3107
 
2993
3108
 
2994
3109
 
3110
+
3111
+
3112
+
3113
+
2995
3114
  /**
2996
3115
  * This helps the Gantt reset colors when the reset function is called.
2997
3116
  * It handles going through the data and resetting the colors.
@@ -3019,6 +3138,10 @@
3019
3138
 
3020
3139
 
3021
3140
 
3141
+
3142
+
3143
+
3144
+
3022
3145
  /**
3023
3146
  * Register the object
3024
3147
  */
@@ -3027,6 +3150,10 @@
3027
3150
 
3028
3151
 
3029
3152
 
3153
+
3154
+
3155
+
3156
+
3030
3157
  /**
3031
3158
  * This is the 'end' of the constructor so if the first argument
3032
3159
  * contains configuration data - handle that.