0

Basically I have a graph and I want 'Sunday,Monday,Tuesday..' on the X-axis. But this information I'm getting from the database and depending on the inputs(i.e the dates) I want my x-axis to display the label.So the labels keep changing. I searched and so far and I've seen examples of only static labels ie .Set('labels',['Sunday','Monday'])

basically I want my graph to display something like on this page http://statcounter.com/demo/summary/

Can anyone help me?

akarsha
  • 3
  • 3

1 Answers1

0

If you're using PHP, you could do it with something like this:

<?php
    $labels = "['" . implode("', '", $arrLabels) . "']";
?>

...

myChart.Set('labels', <?php echo $labels ?>);
Richard
  • 4,809
  • 3
  • 27
  • 46
  • hi is there a way to change `labelsAbove: true,` when i redraw the graph the previous labels on top of the bar graph is just overlapping – guradio Aug 06 '19 at 00:58
  • Set the labels using: foo.set('labelsAbove', true); and then redraw the chart: RGraph.redraw(); – Richard Aug 06 '19 at 07:55