Auto change fillStyle and strokeStyle, doesn't work some times

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 jack yang on 3rd April 2013
I test html that has code as below:
         window.onload = function () {
             var dataArr = [[45, 60, 112, ], [65, 30, 50], [40, 80, 70], [115, 100, 92]];
             var bar5 = new RGraph.Bar('cvs', dataArr);

             bar5.Draw();
         }
And It worked, the fillStyle and strokeStyle changed to different color, that is what I want.

But When I used js to combine three or more dimension data to dataArr, and draw it out, but the color doesn't work correctly.
Error info:
Canvas: strokeStyle, fillStyle is not string,CanvasGradient,CanvasPattern. Operation aborted.

why?
Posted by RGraph support on 3rd April 2013
Hi there,

You have three datapoints in your data array now. The bar chart will use the first three of your chart.colors setting and then repeat them for each subsequent bar.




Richard, RGraph Support

1 Year Priority Support now reduced to £299:
   www.rgraph.net/support
Posted by Enter your name... on 6th April 2013
          window.onload = function () {
              var dataArr = [[45, 60, 112, ], [65, 30, 50], [40, 80, 70], [115, 100, 92]];
              var bar5 = new RGraph.Bar('cvs', dataArr);

              bar5.Draw();
          }
there's no chart.colors setting, but still work, I dont understand.
Thank you for advance, jack yang.
Posted by jack yang on 6th April 2013
Thank you very much. I found the error.
I have more than three datapoints, and set only two colors in my own code.
Thanks for help

Add a reply




« Back to message list