I use Google Sheets API from googleapis 
<https://www.npmjs.com/package/googleapis> to get a spreadsheet and its 
charts. So I have ChartSpec 
<https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/charts#chartspec>.
 
How can be this spec used to visualize the chart in a web application, e.g. 
using Visualization API 
<https://developers.google.com/chart/interactive/docs/reference>? Use case 

A simple web app written in HTML and JS which shows all charts from an 
arbitrary spreadsheet. In the ideal scenario, the charts are rendered just 
like in spreadsheets, so I can see the charts without the necessity to open 
a spreadsheet manually.

   1. A user selects a spreadsheet from a list of predefined spreadsheets 
   (menu)
   2. Web app requests up-to-date data for the selected spreadsheet from 
   Node.js backend
   3. Node.js app gets all charts in the spreadsheet using Google Sheets API
   4. Node.js app responds with necessary data
   5. Web app visualizes the charts that should ideally be interactive (eg. 
   using Visualization API)

Problem 

I have a trouble with steps 4 and 5. In step 3 I receive ChartSpec 
<https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/charts#chartspec>
 
which seems to contain all information but data. Instead of data, there are 
just references to ranges in a form of ChartData 
<https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/charts#chartdata>
 
object.

Creating a custom implementation which gets all referenced data seems 
extremely complicated. Even if I created it on my own, I do not know how to 
create visualizations in step 5.

*What I found and why it is not solution for me?* There are similar 
questions and solutions that use Visualization API to query data from a 
spreadsheet and the visualize it, such as this answer 
<https://stackoverflow.com/a/22492883/1353874>. Why is this not solution 
for me? Because my spreadsheets are created by non-tech people who do not 
follow any good practices, so data cannot be easily queried using Query 
API. The spreadsheets are a mess. The charts are created by the same folks 
and they want to customize it by themselves. What I need is to show already 
existing charts without necessity to make any chart-wise code.

-- 
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-visualization-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/d28e6668-f2fb-46d3-8a90-e6e45bd88cc0n%40googlegroups.com.

Reply via email to