English 中文(简体)
现有谷歌图像图的数据
原标题:Obtain DataTable from existing Google visualization chart

I have drawn a Google visualization table chart. How can I get the DataTable that is used to draw the chart? For example, how to get the value of first 5 rows and column 1.

最佳回答

If you are using the ChartWrapper you can get the DataTable like this:

  var wrapper = new google.visualization.ChartWrapper({
    chartType:  ColumnChart ,
    dataTable: [[ Germany ,  USA ,  Brazil ,  Canada ,  France ,  RU ],
                [700, 300, 400, 500, 600, 800]],
    options: { title :  Countries },
    containerId:  visualization 
  });
  wrapper.draw();
  // get the DT
  var dt = wrapper.getDataTable();
  console.log(dt);

如果你想从数据表中获得价值,你可使用<>getValue(rowIndex,栏目Index)一种数据表方法:

var dt = wrapper.getDataTable();
alert(dt.getValue(3, 1));
问题回答

暂无回答




相关问题
Google Charts: chxl and bhg

http://chart.apis.google.com/chart?cht=bhg&chd=t:3771.5,3220|5508.25,5366.75& chs=400x200&chds=0,9000&chxt=x&chxr=0,0,9000& chm=N*cUSD2s*,000000,0,-1,11|N*cUSD2s*,000000,1,-1,...

出口谷歌视觉图像是没有任何途径?

出口谷歌视觉组织图作为形象是否有任何途径? 我想,这是我网站的一个特点,因此人们可以点击一个 but子或一个链接,......

Google Visualization API - Org Chart Layout

Using the Org Chart in the Google Visualization API, is there a way to flip the chart to a vertical layout instead of horizontal.

How to disable Google Visualizations Tool Tips?

Does anyone know how to disable the tool-tip boxes that popup when a Google Visualizations chart is clicked (Selected)? Following the sample code at Getting Started with Visualizations, the "...

热门标签