0
votes

my line graph is not displaying decimal values instead it is rounding off the decimal values on y axis

var line1 = new RGraph.Line({
        id: 'cvs',
        data: [
            [5.85, 5.86, 5.87, 5.88, 5.89, 5.90, 5.91, 5.92, 5.93, 5.94]
        ],
        options: {
            linewidth: 1,
            backgroundGrid: false,
            title: 'X-Chart',
            colors: ['red'],
            fillstyle: 'rgba(255,0,0,0.2)',
            ymin: 5.75,
            ymax: 6,
            labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
            scale: 0.2,
            textAccessible: true
        }
    }).draw();

thank you

1
please add code snippet - muneebShabbir
var line1 = new RGraph.Line({ id: 'cvs', data: [ [5.85, 5.86, 5.87, 5.88, 5.89, 5.90, 5.91, 5.92, 5.93, 5.94] ], options: { linewidth: 1, backgroundGrid: false, title: 'X-Chart', colors: ['red'], fillstyle: 'rgba(255,0,0,0.2)', ymin: 5.75, ymax: 6, labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], scale: 0.2, textAccessible: true } }).draw(); - Varsha Soni
Edit your question and add this code there. It will be helpful for users to understand your question - muneebShabbir
rgraph.net/docs/line.html#labels you can use your own scaleFormatter - Mahi

1 Answers

0
votes

You should add the scaleDecimals option to your configuration:

...
scaleDecimals: 2,
...

There's an example of it in a demo called line-us-prison-population.html and you can see that by downloading the RGraph archive here:

https://www.rgraph.net/download.html#stable