View the RGraph Facebook page View the RGraph Google+ page Share RGraph on Twitter Share RGraph on LinkedIn

« Back to message list

HBar Javascript errors

Posted by Paul on 20th December 2012
Hi,

When rendering graphs in FF I get 300+ js errors...Anything fixable?

canvas: an attempt to set strokeStyle or fillStyle to a value that is neither a string, a CanvasGradient, or a CanvasPattern was ignored.
localhost:38190/Scripts/RGraphs/RGraph.hbar.js
Line 553

Thanks in advance
Posted by Paul on 20th December 2012
Thought it maybe worth including the config:

{
    "chart.background.grid":false,
    "chart.colors":[
       "Gradient(#ffd737:#FDB515)"
    ],
    "chart.data":[
       29,
       0,
       1,
       0,
       23
    ],
    "chart.gutter.left":80,
    "chart.gutter.right":50,
    "chart.gutter.top":10,
    "chart.labels":[
       "Registered Drivers",
       "Added Licences",
       "Checks in Progress",
       "Nominee Drivers",
       "Foreign Licences",
       "Checks Completed"
    ],
    "chart.labels.above":true,
    "chart.noxaxis":true,
    "chart.noxtickmarks":false,
    "chart.noytickmarks":false,
    "chart.strokestyle":"transparent",
    "chart.tooltips":[
       "Registered Drivers: 29",
       "Added Licences: 0",
       "Checks in Progress: 1",
       "Nominee Drivers: 0",
       "Foreign Licences: 23"
    ],
    "chart.tooltips.event":null,
    "chart.xlabels":false
}els":false}
Posted by Jose Gómez on 23rd September 2013
Same error happening here...
Posted by RGraph support on 24th September 2013
Hi there,

I don't get them on any of the RGraph examples or demos - ensure your using the latest version.




Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
   www.rgraph.net/license#single-site
Posted by Jan on 25th October 2013
I am also seeing these errors, but only with pie charts. Latest stable RGraph, latest Firefox. jQuery 1.8.3

canvas: an attempt to set strokeStyle or fillStyle to a value that is neither a string, a CanvasGradient, or a CanvasPattern was ignored.
www.retrocollect.com/dbtest/js/rgraph/RGraph.pie.js
Line 538

canvas: an attempt to set strokeStyle or fillStyle to a value that is neither a string, a CanvasGradient, or a CanvasPattern was ignored.
www.retrocollect.com/dbtest/js/rgraph/RGraph.pie.js
Line 379

This is my code:

     var json = <?echo($statistics->createRGraphJSON('g_distribution'));?>;
     var gChart = new RGraph.Pie('gChart', json.data)
         .Set('chart.labels', json.labels)
         .Draw();

The PHP-passed JSON is valid and both values and labels show up fine in the pie. I think this might be a problem with the colors, I have 21 sections in the pie, but only the first 13 differ in color. I haven't yet checked the docs if that's expected, but it should not produce errors even if it is.
Posted by RGraph support on 25th October 2013
Hi there,

IIRC I I've recently been through the Pie and HBar charts looking for those errors. Either way it's nothing to be concerned about - it's just trying to set a color property to an illegal value (ie not a string, gradient or pattern) - though it doesn't affect the drawing of the Pie.

As for running out of colors - by default there's only 13 colors configured so if you have more segments than this you can set the chart.colors option to an array with the relevant amount of colors.




Richard, RGraph Support
Please remember to link to the RGraph website (or buy an RGraph
license and you don't need to!)

Single developer license for £199:
   www.rgraph.net/license#one-developer
Posted by Jan on 25th October 2013
Thanks a lot :) I'd argue that "nothing to be concerned about" is a matter of opinion though, I like pushing out error-free code to clients ;) It also makes debugging messy as the console is always flooded with these errors and you have to find the "real" ones in between.
Posted by RGraph support on 25th October 2013
Hi there,

The errors have been present for some time - it wasn't possible to find them though because Firebug never used to provide a line number for them.


Richard, RGraph Support
Please remember to link to the RGraph website (or buy an RGraph
license and you don't need to!)

Single developer license just £199:
   www.rgraph.net/license#one-developer

Replies are closed


« Back to message list