I have a problem with an X axis not redrawing properly

Share RGraph:  

« 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 Zsolt on 10th August 2017
Hi Richard,

Here I am again :)

The situation:
I have two charts on different canvases. One of them is a hbar with an xaxis with scale (draw separated), and the other one is a donut (or anything else).
There is a context menu on hbar to change the xmax value (average max / real max). When I changing it I have to redraw the hbar and the xaxis also.
If I use the clear canvas and draw (or redraw) functions the xaxis drawing without numbers.


My only solution was I reset the canvas and register again the two objects, like this:

RGraph.reset(canvas);
bar.set('chart.noregister', false);
xAxis.set('chart.noregister', false);
RGraph.register(bar);
RGraph.register(xAxis);

and change the settings and draw them again.


My questions are
- why it doesn't display the scale values when I'm using the clear function (it creates empty spans),
- the reset clear the registry, but why not change the noregister chart properties to false
- is it the right way how I solved it or there is better one

Thanks for your help, as always
Zsolt
Posted by Richard on 10th August 2017
Hi there,

> - why it doesn't display the scale values when I'm using the clear function (it
> creates empty spans),

No idea. Are you changing the text color?

> - the reset clear the registry, but why not change the noregister chart properties
> to false

The rest function has no need to alter the noregister flag. It simply clears the registry - and if you redraw a chart it re-registers it. Unless you have set the noregister flag to true.


> - is it the right way how I solved it or there is better one

You could try setting textAccessible to false on both objects so that it uses canvas text instead. It should cause fewer issues.
...
textAccessible: false,
...



Richard
Posted by Zsolt on 10th August 2017
Hi,

thanks for your quick answers.
> No idea. Are you changing the text color?
I'm set the text color properly, and not changing it later

> The rest function has no need to alter the noregister flag. It simply clears the registry - and if you redraw a chart it re-registers it. Unless you have set the noregister flag to true.
After the reset the RGraph.redraw or the RGraph.redrawCanvas not draw the chart
The bar.draw is working, but the chart not will be registered because of the true value of the "noregister" property (and when I'm clicking on an other chart on an other canvas the hbar just disappearing which is funny just not what I want)

> You could try setting textAccessible to false
Right now I have to use it with true, because of I'm displaying the scale in vertical (I'm waiting for your next version - the 4.63, which will solve my problems :))

Best regards,
Zsolt
Posted by Richard on 10th August 2017
Hi there,

> (I'm waiting for your next version - the 4.63, which will solve my problems :))

Well I've just released a beta version today - so try that.



Richard
Posted by Zsolt on 10th August 2017
Hi,

thanks, I will try.
Is it waiting for bug fix only, or maybe there will be new functionality also in the stable version?

Zsolt
Posted by Richard on 10th August 2017
Hi there,

There's a few new features that I want to add. Nothing major - I'm just moving at a slower pace these days!




Richard

Add a reply




« Back to message list