Canvas does not work well in the tablet android

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 Daniel on 11th October 2016
I thank you for the excellent work done by you.

Loading the page the chart appears as well.

But when I want to see other values ​​I use the onclick javascript to display another result on the chart and it is here that appears the chart and then is covered by a black background now I can not see.
If I do scrool back to fade the background.

I am using a tablet with android.
Posted by Daniel on 11th October 2016
continuation - I'm sorry I'm using new RGraph.Bar
Posted by Richard on 12th October 2016
Hi there,

I don't have an Android tablet to test on - how does it look on a desktop PC?



Richard
Posted by Daniel on 13th October 2016
the part of the canvas should show the graphic is all black.
Posted by Richard on 13th October 2016
Hi there,

I'll need to see an example of it.



Richard
Posted by Daniel on 13th October 2016
Sending picture mode.

www.maismemoria.pt/teste.php
Posted by Richard on 13th October 2016
Hi there,

You could try clearing the canvas before you draw the second chart:

RGraph.clear(myBar.canvas);

Or restting it:

RGraph.reset(myBar.canvas);




Richard
Posted by Daniel on 13th October 2016
Miy code is this.

Where stay.

       var bar = new RGraph.Bar('cvs', [vaues])
        .set('titleXaxisX','100')
        .set('labels', ['Iformations'])
        .set('ymax', max)
        .set('hmargin', 2)
        .set('strokestyle', '#000')
        .set('labels.above', true)
        .set('background.grid.autofit.numvlines', 1)
       //.draw();
       
      

var line = new RGraph.Line('cvs', [value,value])
        .set('colors', ['green'])
        .set('tickmarks', null)
        .set('background.grid', false)
        .set('ymax', max)
       .draw();
       
       var coords = line.coords[0];
      
       var img = new RGraph.Drawing.Image('cvs', coords[0], coords[1], 'image draw')
        .set('halign', 'center')
        .set('valign', 'center')
        .set('alpha', 100)
        .set('tooltips', ['<b>information</b>'])
       .draw();
Posted by Richard on 13th October 2016
Hi there,

Well the URL of the image is entirely wrong.



Richard
Posted by Daniel on 13th October 2016
Oh yeah, I did not want that to address the image but everything is working well rest assured the problem is the same tablet.
Remember the link that sent the chart to work is so even that image is where I put the url.
Posted by Richard on 13th October 2016
Hi there,

Afraid I don't know - and I don't have an Android tablet to test with.



Richard
Posted by Daniel on 13th October 2016
It's all right.
I thank you for the excellent work done by you.

Where can I use the line of code to reset or clear.
Posted by Richard on 14th October 2016
Hi there,

Try using it just before you draw the second chart.




Richard
Posted by Daniel on 14th October 2016
Hello!
No work.

Something that is doing wrong.
I did not understand "myBar.canvas".
RGraph.clear(myBar.canvas);
Posted by Richard on 14th October 2016
Hi there,

"myBar" is the name of the RGraph object - which in the code that you provided would be "line" or "bar" and the .canvas is a property representing the canvas tag (the same as whast you get from document.getElementById() ).



Richard
Posted by Daniel on 14th October 2016
Uncaught TypeError: Cannot read property 'width' of undefined

no work.

var bar = new RGraph.Bar('cvs', [valores])

var canvas = document.getElementById('cvs');

RGraph.Reset(bar.canvas);
Posted by Richard on 14th October 2016
Hi there,

You need to provide an example URL.



Richard
Posted by Daniel on 25th October 2016
Hello!
I found a more practical solution, convert graphic on canvas for image.
Problem solved.

Add a reply




« Back to message list