My code looks like this:
var data = new google.visualization.DataTable();
data.addColumn('string', 'Distance');
data.addColumn('number', 'Elevation');
data.addRows(callback.data);
var chart = new
google.visualization.AreaChart(document.getElementById('contourLine'));
chart.draw(data, {
width: '100%', //684
height: 250,
pointSize: 0,
min: 0,
axisFontSize: 12,
legend: 'none',
colors: ['#177245'],
title: 'Höjdkurva',
titleX: 'distans (km)',
titleY: 'hojd (m)'
});
And callback is an javascript object created from a JSON request from
my server, and callback.data is an array, see bellow.
{"code":1,"data":[["53",26],["65",25],["87",26],["124",24],["182",23],
["203",23],["233",23],["291",25],["364",24],["369",24],["383",24],
["404",26],["447",24],["477",24],["543",25],["561",24],["581",25],
["614",27],["722",25],["733",25],["775",22],["822",24],["879",26],
["890",24],["909",23],["930",23],["994",23],["1046",23],["1077",23],
["5113",32],["5122",33],["5127",35],["5128",36],["5175",36],["5273",
34],["5309",34],["5333",32],["5357",31],["5398",30]]}
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
The code works in all browser except for IE6, 7and 8. I don't know if
I'm doing something wrong or if it's a bug in the Visualization
library. But I could not find any bug report and I can't be the first
one to have had this problem.So I though I did something wrong. The
JSON object is what I call "callback" in my code above, and
"callback.data" is an array of arrays (that is an array of datapoints
which I load with addRows).
On Feb 15, 12:36 pm, Viz Kid <viz...@google.com> wrote:
> Hi.
>
> It wasn't clear from your post if this happens only in IE or other browsers
> as well (meaning if you tested it on other browsers)?
> Can you also give a live example of your code which doesn't work?
>
> Best,
> Viz Kid
>
> > google-visualizati...@googlegroups.com<google-visualization-api%2Bunsu...@googlegroups.com>
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
You can see the problem in this page for example:
http://www.opentrailmap.net/viewtrail.php?id=4
I'm loading the data on the page with Mootools request.JSON. It's the
second JSON request that loads the graph data.
In gMap.js: loadGraph is the function which makes the JSON request,
and drawContourLine is the callback function which initializes the
graph.
If you like I can upload a version of the javascript which is easier
to read.
On Feb 15, 1:26 pm, Viz Kid <viz...@google.com> wrote:
> I just tried it now using IE8 with some rows which works fine.
> If you can send us a live page where you see the problem we can try to help
> you better.
>
> Viz Kid
>
> > <google-visualization-api%2Bunsu...@googlegroups.com<google-visualization-api%252Buns...@googlegroups.com>
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
Thanks for your help, I will do some more debuging to see what is
wrong.
Once more, thanks for your help.
On Feb 15, 2:29 pm, Viz Kid <viz...@google.com> wrote:
> Hi.
>
> > > > <google-visualization-api%2Bunsu...@googlegroups.com<google-visualization-api%252Buns...@googlegroups.com>
> > <google-visualization-api%252Buns...@googlegroups.com<google-visualization-api%25252Bun...@googlegroups.com>
I would just like to explain what the problem was. It was totaly my
fault but just in case someone makes the same misstake...
I used Google jsapi to load the graph component, and then I set an
google.SetOnLoadCallback to know when it was loaded.
At the same time I used a "doomready" callback. The problem was the in
IE the SetOnLoadCallback fas called before the doomready call. And in
my case there was some parts of the webpage that had not been
initialized yet.
To solve the situation I keeped the "doomready" callback and used the
"Dynamic Loading" functionality instead.
Once again, thanks for the good support, cheers!
> > > > > > > title: 'Höjdkurva',
--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/y4yvI6wTheQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.