The textAccessible option set to false makes the Y axis labels disappear

Share RGraph:   Share or Like RGraph on Facebook!

« 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 Brandon Thompson on 24th August 2016
I am trying to make a line graph with sideways X labels and regular Y axis labels. I have read that the textAccessible property cannot be true for this to work, and the X labels do turn sideways and look very pretty, but suddenly the Y axis labels all show 0%. If I set the textAccessible value to true, the Y axis labels are correct, but there are too many X labels to fit and be readable. Am I doing something wrong?

new RGraph.Line({
         id: graphid,
         data: data,
         options: {
             labels: labels,
             key: ['Corp', 'Fran'],
             unitsPost: '%',
             backgroundGridAutofitNumvlines: 17,
             colors: ['#666','#090'],
             filled: true,
             fillstyle: [
                 'Gradient(rgba(48,48,48,0.75):rgba(100,100,100,0.75)',
                 'Gradient(rgba(0,100,0,0.75):rgba(85,255,118,0.9)'
             ],
             linewidth: 3,
             numxticks: 17,
             tickmarks: null,
             shadow: null,
             gutterBottom: 55,
             textAngle: 90,
             spline: true,
             textAccessible: false
         }
     }).draw();
Posted by Richard on 24th August 2016
Hi there,

You got me - because this is the code you sent:

www.rgraph.net/fiddle/view.html/textaccessible-makes-y-labels-zero

All the labels are fine with the textAccessible option set to false. I had to use my own data and labels but I doubt that would change much - but try sending it and I'll add it to the example.


Richard
Posted by Brandon Thompson on 24th August 2016
Richard, thank you very much for your quick response and for this super-useful application!

I was able to get the numbers to display by removing the "unitsPost: '%'" line.
I'm not sure if the application was confused because the data variable contained decimal numbers or because the percentages went over 100%, but in case you're curious, here was the data I used:

[0.00,49.75,49.75,88.06,88.06,95.02,95.52,97.51,97.51,98.51,98.51,98.51,98.51,98.51,99.00,99.50,99.50,99.50,0.00,40.50,40.50,77.56],[77.56,86.94,90.30,97.52,97.52,98.65,152.84,182.02,196.91,196.96,197.62,197.65,197.86,197.96]

Thanks again!
Posted by Richard on 24th August 2016
Hi there,

Hmm, you could try using \r\n at the start of every other label to make them span multiple lines like this:

www.rgraph.net/fiddle/view.html/textaccessible-makes-y-labels-zero

Richard

Add a reply




« Back to message list