Getting the X axis with your labels


« 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 Bimo on 13th February 2013
The next link i have my graph imgur.com/qfBe9Ny

<script>
         chart = new RGraph.Line('cvs', [0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0, 0.23999999999978, 0.56999999999971, 1.1999999999989, 1.4899999999998, 2.7199999999993, 3.7899999999991, 4.2099999999991, 4.3799999999992, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00]);
         chart.Set('chart.background.grid.autofit', true);
         chart.Set('chart.background.grid.autofit.numvlines',24);
         chart.Set('chart.background.grid.autofit.numhlines',5);
         chart.Set('chart.background.grid.autofit.align',true)
         chart.Set('chart.numyticks',5);
         chart.Set('chart.numxticks',24);
         chart.Set('chart.background.grid.autofit.align',true);
         chart.Set('chart.gutter.left', 35);
         chart.Set('chart.gutter.right', 5);
         chart.Set('chart.hmargin', 10);
         chart.Set('chart.tickmarks', 'endcircle');
         chart.Set('chart.labels', ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23']);
         chart.Set('chart.text.angle',90);
        
         chart.Draw();
     </script>

How is it possible to have my numbers aligned with my ticks?
Posted by Bimo on 13th February 2013
I found the problem
It this tiny line that should be removed

chart.Set('chart.hmargin', 10);
Posted by RGraph support on 13th February 2013
Hi,

You can use chart.numxticks - and you need to set it to either one more, equal to or one less than the number of labels. IIRC it's one less. So if you have 6 labels set chart.numxticks to 5.

But if you use chart.hmargin - the ticks will never align. So get rid of it.

Richard, RGraph Support

1 Year Premium Support now reduced to £299:
   www.rgraph.net/support

Add a reply

 




« Back to message list
RGraph on social media