Scatter chart labels huddled after upgraded

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 sh2sg on 1st April 2013
Hi,

I was using the stable version in January and it worked fine with the Date/time scatter chart. However after I upgraded to stable version in March, those x labels got huddled with the same code.

Here is the sample code:

<!DOCTYPE html >
<html>
<head>
<script type="text/javascript" src="RGraph.common.core.js" ></script>
<script type="text/javascript" src="RGraph.scatter.js" ></script>
<title>A Scatter chart using Date/Time values</title>
</head>
<body>

<canvas id="cvs" width="600" height="200">[No canvas support]</canvas>

<script>
window.onload = function ()
{
     var data = [
         [1362355200000,5],
         [1362441600000,6],
         [1362528000000,5],
         [1362614400000,9],
         [1362700800000,12],
         [1362960000000,12],
         [1363046400000,11],
         [1363132800000,9],
         [1363219200000,4],
         [1363305600000,0],
         [1363564800000,9],
         [1363651200000,8],
         [1363737600000,7],
         [1363824000000,13],
         [1363910400000,16],
         [1364169600000,11],
         [1364256000000,10],
         [1364342400000,21],
         [1364428800000,20],
         [1364515200000,20]
     ];

     var labels = [
         ['4 Mar', 1362355200000],
         ['11 Mar', 1362960000000],
         ['18 Mar', 1363564800000],
         ['25 Mar', 1364169600000]
     ];

     var scatter = new RGraph.Scatter('cvs', data);
     scatter.Set('chart.ymin', 0);
     scatter.Set('chart.ymax', 21);
     scatter.Set('chart.xmin', 1362355200000);
     scatter.Set('chart.xmax', 1364515200000);
     scatter.Set('chart.labels', labels);
     scatter.Set('chart.line', true);
     scatter.Set('chart.line.linewidth', 1);
     scatter.Set('chart.line.colors', ['red']);
     scatter.Set('chart.line.shadow.color', '#999');
     scatter.Set('chart.line.shadow.blur', 15);
     scatter.Set('chart.line.shadow.offsetx', 0);
     scatter.Set('chart.line.shadow.offsety', 0);
     scatter.Set('chart.tickmarks', null);
     scatter.Draw();
}
</script>

</body>
</html>

And here are the results:

Old version:
[img]oi46.tinypic.com/1dxzwx.jpg[/img]

New version:
[img]oi45.tinypic.com/1fh4wl.jpg[/img]

Any advice?

Thanks
Posted by RGraph support on 1st April 2013
Hi there,

Ok, this is fixed now - so try the new library.


Richard
Posted by sh2sg on 1st April 2013
Hi Richard,

Thanks for your prompt response, the fix works perfectly.

Add a reply




« Back to message list