0

I've got these weird marks on my RGraph x-axis. Any idea what's causing it?

Here is a screenshot (I marked the unwanted marks with red arrows)

screenshot

Here is my JavaScript code that prints the line.

function PrintLine(labels, tooltips, data, color, legend) {
  var line = new RGraph.Line(CANVAS_ID, data);

  line.Set('chart.labels', labels);
  line.Set('chart.background.grid.hlines', false);
  line.Set('chart.background.grid.autofit.numvlines', labels.length-1);
  if(legend[0].length > 0) {
    line.Set('chart.colors', legend[0]);
    line.Set('chart.key', legend[1]);
    line.Set('chart.key.position', 'gutter');
    line.Set('chart.key.position.gutter.boxed', false);
    line.Set('chart.key.position.x', 400);
  }

  line.Set('chart.tooltips', tooltips);
  line.Set('chart.shadow', true);
  line.Set('chart.ylabels', false);
  line.Draw();
}
Aximili
  • 28,626
  • 56
  • 157
  • 216

2 Answers2

1

It looks as though you may have a previous chart staying around - which you can get rid of by clearing the ObjectRegistry:

RGraph.ObjectRegistry.Clear();

Richard
  • 4,809
  • 3
  • 27
  • 46
  • Also see here:http://stackoverflow.com/questions/10853678/rgraph-reload-the-previous-graph-when-i-reload-the-page-and-i-click-the-body-of/10855605#10855605 – Richard Nov 08 '12 at 08:33
0

Adjust the line settings chart.numxticks to the number of X tickmarks you want .set('chart.numxticks',n)

0-PETER-0
  • 1
  • 1