Re: [visualization-api] Providing data by series in Google Chart Tools, possible?

32 views
Skip to first unread message

Sergey Grabkovsky

unread,
Dec 21, 2012, 3:41:45 PM12/21/12
to google-visua...@googlegroups.com
Unfortunately we do not support adding data by series. Can you elaborate on why adding null values is problematic? Isn't it possible to write a tool that consolidates multiple series into a data table?

- Sergey


On Fri, Dec 21, 2012 at 3:24 PM, Maciek <mac...@ateista.net> wrote:
I would like to define data for my chart like in jqPlot (http://www.jqplot.com/tests/date-axes.php).

Adding 'null' values is problematic. Best solution would be adding data by series like:

serie1
=[['2008-06-30 8:00AM',4], ['2008-7-30 8:00AM',6.5], ['2008-8-30 8:00AM',5.7], ['2008-9-30 8:00AM',9], ['2008-10-30 8:00AM',8.2]];

Can I get this method of providing data in Google Chart Tools

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/b-XLQt3Dq9AJ.
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.

Maciek

unread,
Dec 21, 2012, 4:52:08 PM12/21/12
to google-visua...@googlegroups.com
It's problematic because number of series (and dates) is various in my script... So I'll think about consolidate it adding by series is not possible.


W dniu piątek, 21 grudnia 2012 21:41:45 UTC+1 użytkownik Sergey napisał:
Unfortunately we do not support adding data by series. Can you elaborate on why adding null values is problematic? Isn't it possible to write a tool that consolidates multiple series into a data table?

- Sergey


On Fri, Dec 21, 2012 at 3:24 PM, Maciek <mac...@ateista.net> wrote:
I would like to define data for my chart like in jqPlot (http://www.jqplot.com/tests/date-axes.php).

Adding 'null' values is problematic. Best solution would be adding data by series like:

serie1
=[['2008-06-30 8:00AM',4], ['2008-7-30 8:00AM',6.5], ['2008-8-30 8:00AM',5.7], ['2008-9-30 8:00AM',9], ['2008-10-30 8:00AM',8.2]];

Can I get this method of providing data in Google Chart Tools

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/b-XLQt3Dq9AJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualization-api+unsub...@googlegroups.com.

Sergey Grabkovsky

unread,
Dec 21, 2012, 5:13:30 PM12/21/12
to google-visua...@googlegroups.com
I see. Well unfortunately we don't have a built in solution to do what you want, but here is some code that converts a list of series to a 2d array. You just need to make sure that your dates are all consistent (i.e. '2008-01-01') and it should work well.

function array2fromSeries(allSeries{
  var createNulls function({
    var [];
    for (var in allSeries{
      l.push(null);
    }
    return l;
  };
  var domain {};
  var domainList [];
  for (var in allSeries{
    var series allSeries[s];
    for (var in series{
      var item series[i];
      if (!(item[0in domain){
        domain[item[0]createNulls();
        domainList.push(item[0]);
      }
      domain[item[0]][sitem[1];
    }
  }
  var out [];
  domainList.sort();
  for (var in domainList{
    var domainList[i];
    out.push([d].concat(domain[d]));
  }
  return out;
}

- Sergey



To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages