Common issues

  Read comments...

These are some common issues that you should be aware of. If you're having trouble, you may want to look through these to see if any apply to you or may be the source of your problem.

Dynamic chart background titles and the textAccessible option

When using the textAccessible option with a dynamically updating chart that use the RGraph.Background.draw() function (Bar, Line, Scatter etc) some text may not appear. A resolution for this is due to be added to the next version of RGraph (4.55 all being well).

ActiveX error in Internet explorer 9 (MSIE 9)

With the default security settings in Internet Explorer 9 running active content (ie Javascript in this case) in local files triggers an ActiveX warning: "Internet Explorer restricted this webpage from running scripts or ActiveX controls" You can do two things to avoid this:

Jerky animations

Other elements on your page can effect the speed and smoothness of the RGraph effects. An example is that the RGraph website formerly had a Line chart with an animation that was made jerky and slowed down due to a Facebook social widget. In this case a slight delay before loading the widget could allow the animation to finish first.

Old charts keep reappearing when drawing multiple charts on one canvas

Since the ObjectRegistry was introduced objects have to be registered regardless of whether they use dynamic features or not. As a result of this you may be experiencing objects being redrawn when you don't want them to be. To solve this you need to remove them from the ObjectRegistry. How to do this is documented here.

Custom text or drawings disappearing

HTML5 canvas has a "fire and forget" methodology. Meaning that whatever you draw on the canvas is not remembered and automatically redrawn. The RGraph charts are redrawn because they're remembered via the ObjectRegistry. If you want to add your own text or draw on your chart you can just draw it after the chart - but if you use dynamic features (such as tooltips) that redraw the chart it will be lost when the chart is cleared and redrawn.

To get around this you can use the ondraw event so that your text/drawings are redrawn each time the chart is:

myChart.ondraw = function (obj)
{
    // Draw the text here
    obj.context.fillStyle = 'red';
    RGraph.Text(...);
}

Google Chrome not initially drawing charts

You may experience an issue in Google Chrome where your charts are not initially drawn. A variety of things can affect this including (for example) tag placement. You can get around this by using the window.onload event to create your charts in or by calling the redraw method after you create and draw your chart.

RGraph.redraw()
Share RGraph
X

Comments