Small numbers in a Bar chart - labels aren't showing correctly


« 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 Holger on 28th July 2016
Hello,

I want to show this data in a bar chart:
  <script>
  
     data = [0.0708,0.0708,0.0705,0.0707,0.0706,0.0699,0.0698,0.0697,0.0701,0.0698,0.0697,0.0697,0.0696,0.0699,0.0698,0.0701,0.0697,0.07,0.0697,0.07,0.0698,0.0701,0.07];

     new RGraph.Bar({
         id: 'cvs',
         data: data,
         options: {
             textAccessible: true,
             //scaleZerostart: true,
             backgroundGridAutofitNumvlines: 0,
             linewidth: 0,
             shadow: false,
             hmargin: 5,
             colors: ['Gradient(pink:red:#f33)', 'Gradient(green:#0f0)'],
             labelsAbove: true,
             labels: ['7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','0','1','2','3','4','5'],
             tooltips: ['0,0708','0,0708','0,0705','0,0707','0,0706','0,0699','0,0698','0,0697','0,0701','0,0698','0,0697','0,0697','0,0696','0,0699','0,0698','0,0701','0,0697','0,07','0,0697','0,07','0,0698','0,0701','0,07'],
             clearto: 'white',
             variant: '3d',
             gutterTop: 50,
             gutterBottom: 50,
             noaxes: true
         }
     }).wave({frames: 60});
</script>

But the labels on top of the bars are all zero, and the y-axis also.

Is there any property, which I can set ?

Regards
Holger
Posted by Richard on 28th July 2016
Hi there,

The defaults for the labels need updating if you have decimals. Try this: various properties for labels have been updated (notably textAccessible) and the size of the chart has also been increased.

www.rgraph.net/fiddle/view.html/3d-bar-chart-with-labels-above






Richard

PLEASE READ:

If RGraph has helped you please give your feedback - thanks! You can give your feedback or leave a testimonial by adding a forum post or clicking on the speech bubble icon at the very top right.

But most of all: Please link to the RGraph website (get information on how to do it by clicking on the chain icon at the top right of the page)
Posted by Holger on 28th July 2016
Hi Richard,

thanks a lot, with using 'scaleDecimals' and 'labelsAboveDecimals' the correct numbers are shown. That's the important thing!

But the properties 'labelsAboveAngle' and 'labelsAboveOffset' have no effect on my browsers (IE11 and Firefox 38.8).
Sorry, I can't test here with other browsers...

Kind regards
Holger
Posted by Richard on 28th July 2016
Hi there,

Have you set textAccessible to false? Accessible text doesn't support angles.






Richard

PLEASE READ:

If RGraph has helped you please give your feedback - thanks! You can give your feedback or leave a testimonial by adding a forum post or clicking on the speech bubble icon at the very top right.

But most of all: Please link to the RGraph website (get information on how to do it by clicking on the chain icon at the top right of the page)
Posted by Holger on 28th July 2016
Bingo!

Thanks ;-)
Holger

Add a reply

 




« Back to message list
RGraph on social media