google-visualization

How To Get Chart From Sheet in Google Apps Script

寵の児 提交于 2019-12-23 05:09:06
问题 I am using Google Apps Script with Spreadsheets. I am trying to find out a way to return a Google Chart(static or dynamic, doesn't matter). The data set that I will be using will be in a spreadsheet, and I want the Google Chart to be returned in the form of a web app(URL should start with: script.google.com/macros/idforscript). I have tried to use the official Google Apps Script tutorials, but even they don't work, leaving me, when I open the page, with a [400] error in a red rectangle. Here

Google Analytic Embed API chart: Responsive

ぃ、小莉子 提交于 2019-12-23 04:16:14
问题 How would I make this Google Analytic Embed API chart responsive? I noticed that the demo on this page is reponsive: https://ga-dev-tools.appspot.com/embed-api/basic-dashboard/ I have also seen various ways of doing this with Google Charts here https://code.google.com/p/google-visualization-api-issues/issues/detail?id=1056 <!doctype html> <html lang="en"> <head> <title>Google Charts</title> <script> (function(w,d,s,g,js,fs){ g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(f){this.q

Different colour of fill and stroke in Google area chart

扶醉桌前 提交于 2019-12-23 02:52:45
问题 Please, look at the image below. What I need is to have yellow colour instead of grey but it seems that in Google area charts the fill colour is always the same as the colour of the stroke, you can only specify areaOpacity which is 0.5 in this particular case. See this image now: I can change manually the fill colour of the <path> element but it does not seem to be exposed in chart API. At least, I went through Q&A sites and documentation and didn't find it; hope I didn't overlook it. Could

Google visualization not working with local file

余生长醉 提交于 2019-12-23 02:52:17
问题 I'm working with a treemap, but the scale is coming out black. (related question: Google TreeMap fill value set to _ABSTRACT_RENDERER_ID_1). After reading that I was able to track down the problem to the code that google generates. It looks like the definitions are being declared correctly, but then the url to them looks like maybe doesn't work with local files. Perhaps because I'm working with a local file, see below: url(file:///D:/... ) <defs> <linearGradient gradientUnits="userSpaceOnUse"

One x-axis tick every 7 points

只愿长相守 提交于 2019-12-23 02:45:47
问题 In area charts, I'd like to have a tick + label on x-axis every 7 points only, instead of one x-axis-tick per point. How to do that in the following code? google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Year', 'Sales', 'Expenses'], ['2013', 1000, 400], ['2014', 1170, 460], ['2015', 660, 1120], ['2016', 1030, 540] ]); var options = { title: 'Company Performance',

PHP: How to pass multiple variables to an array?

荒凉一梦 提交于 2019-12-23 02:22:15
问题 In the google chart api, the data for the chart is set by this line: data.addRows([ ['2004', 1000, 400], ['2005', 1170, 460], ['2006', 860, 580], ['2007', 1030, 540] ]); I want to be able to set this data from data in my database. Below is an image of my database: I want to take all values of salePrice and unitPrice and display the values on a line chart that corresponds to the period they were created. Here is my code: <?php include("getteam.php"); $saleprice = mysql_query(" SELECT

Google Visualization Org Chart - dynamically reduce space between nodes

时光怂恿深爱的人放手 提交于 2019-12-23 01:13:10
问题 I'm creating an org chart using google's code google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Name'); data.addColumn('string', 'Manager'); data.addColumn('string', 'ToolTip'); data.addRows([ [{v:'Mike', f:'Mike<div style="color:red; font-style:italic">President</div>'}, '', 'The President'], [{v:'Jim', f:'Jim<div style="color:red; font-style:italic">Vice President</div>'}, 'Mike', 'VP'], ['Alice', 'Mike', '

Google Chart horizontal scrolling

可紊 提交于 2019-12-23 00:48:09
问题 I'm trying to set the visualization of the graph to showing a maximum of 4 months with the possibility to scroll horizontally. I have tried to set some property like hAxis, but the page retun me back an error "a.getTime is not a function" when I set it. Another problem is that pick to zoom and horizontal scrolling only work in chrome desktop, but not in android webview. <html> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script type="text

Google line chart not reloading when I reload the div

六月ゝ 毕业季﹏ 提交于 2019-12-22 22:20:55
问题 I am having issue with Google line chart API. When I reload the div, the line chart does not load again. This is the code for line chart <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Year'); data.addColumn('number', 'Sales'); data.addRows

Google Gantt Chart

99封情书 提交于 2019-12-22 18:33:11
问题 I am using the Gantt Chart provided by Google. I have added a listener to when I click on any of the elements or entity in attempt to return the row/columns data, but it is returning empty, function selectHandler() { var selectedItem = chart.getSelection(); if (selectedItem) { console.log(selectedItem); } } google.visualization.events.addListener(chart, 'select', selectHandler); Here is my attempt on jsfiddle: https://jsfiddle.net/30cuaarb/ 回答1: Selection does not seem to work with google