the curve is not drawn completely

47 views
Skip to first unread message

copiisa offshore

unread,
Sep 2, 2020, 3:47:11 PM9/2/20
to Google Visualization API
I have this problem, the line is not drawn completely, I am using php and mysql, the data I bring from a BD as it is in the attachment, what I am looking for is that the line or the curve is shown complete, if someone has something solution
multiline.png

Daniel LaLiberte

unread,
Sep 2, 2020, 3:57:07 PM9/2/20
to Google Visualization API
It's not clear if your chart is produced inside sheets (which uses a separate internal charting library), or separately using Google Charts.  If it's the latter, my guess is that you should enable the interpolateNulls option, and also sort the data by whatever you are using for the horizontal axis.

On Wed, Sep 2, 2020 at 3:47 PM copiisa offshore <web.c...@gmail.com> wrote:
I have this problem, the line is not drawn completely, I am using php and mysql, the data I bring from a BD as it is in the attachment, what I am looking for is that the line or the curve is shown complete, if someone has something solution

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/1666e40d-1567-4684-a3fd-5308ec7a1735n%40googlegroups.com.


--

sistemas-web

unread,
Sep 2, 2020, 5:28:56 PM9/2/20
to google-visua...@googlegroups.com

Thank you for answering as soon as possible, I attach the file I am using, I bring the data and store it in an array, I convert it to json, with a loop I can print the curves that I need to show, as I am new to this issue of google charts, Possibly I am doing it wrong, I would appreciate your help
cotiza.php

Daniel LaLiberte

unread,
Sep 2, 2020, 6:32:41 PM9/2/20
to Google Visualization API
A few things you should do:

Update how you load Google Charts:

Either sort the datatable yourself based on the hAxis (or x axis) values, or use getSortedRows and then construct a DataView and use setRows to set the rows of the DataView using the sorted row indices.   You should be inserting null values any place that there isn't a value in each of your series corresponding to the x value.  Maybe you are getting that same effect by using all those joins now, but it is difficult for me to tell.

Then add interpolateNulls: true to the options.

It would be helpful for your debugging, and if you want more help from me, for you to generate a google.visualization.Table using the operacion data that you are using now with the LineChart.  

sistemas-web

unread,
Sep 3, 2020, 10:33:39 AM9/3/20
to google-visua...@googlegroups.com
Thanks again for your contribution, I am reviewing the document in detail

sistemas-web

unread,
Sep 7, 2020, 11:37:27 AM9/7/20
to google-visua...@googlegroups.com



Hello, good day, I tried what you told me, checking and I have well defined the hAxis axis, all I want to know is why it does not paint the entire curve, now if I show a single curve it can be seen without a problem, the problem comes when I try to insert more curves the raven stops being seen, attached the curves
grafica1.png
grafica2.jpg
Reply all
Reply to author
Forward
0 new messages