Patch to add chart.labels.above.color option

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by FReZ on 20th July 2013
Hi,

just made a patch to add a "chart.labels.above.color" option to change above text color in bar graph.


--- ORIGINAL/RGraph.bar.js 2013-06-01 16:03:08.000000000 +0200
+++ RGraph.bar.js 2013-07-20 14:32:02.000000000 +0200
@@ -12,6 +12,7 @@
      * o------------------------------------------------------------------------------o
      */
     
+ // Modified by FReZ/20130720 to add chart.labels.above.color option
      if (typeof(RGraph) == 'undefined') RGraph = {};
 
      /**
@@ -78,6 +79,7 @@
              'chart.labels': null,
              'chart.labels.ingraph': null,
              'chart.labels.above': false,
+ 'chart.labels.above.color': null,
              'chart.labels.above.decimals': 0,
              'chart.labels.above.size': null,
              'chart.labels.above.angle': null,
@@ -984,7 +986,12 @@
                                      var valign = 'bottom';
                                  }
     
- co.fillStyle = prop['chart.text.color'];
+ // Above labels color
+ if (this.properties['chart.labels.above.color']) {
+ co.fillStyle = prop['chart.labels.above.color'];
+ } else {
+ co.fillStyle = prop['chart.text.color'];
+ }
     
                                  RGraph.Text2(this, {'font': prop['chart.text.font'],
                                                      'size': typeof(prop['chart.labels.above.size']) == 'number' ? prop['chart.labels.above.size'] : prop['chart.text.size'] - 3,
@@ -1200,7 +1207,11 @@
                              // Turn off any shadow
                              RG.NoShadow(this);
     
- co.fillStyle = prop['chart.text.color'];
+ if (prop['chart.labels.above.color']) {
+ co.fillStyle = prop['chart.labels.above.color'];
+ } else {
+ co.fillStyle = prop['chart.text.color'];
+ }
     
                              // Angled above labels
                              if (prop['chart.labels.above.angle']) {
Posted by RGraph support on 20th July 2013
Hi there,

Thanks - I'll take a look at it.

Richard, RGraph support

Add a reply




« Back to message list