Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8667301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:55:57+00:00 2026-06-12T17:55:57+00:00

I’m making an App with Titanium Studio, and tried to use a webView and

  • 0

I’m making an App with Titanium Studio, and tried to use a webView and Google Charts to Visualize some data. The data is in an two-dimensional array, like so:

[["Tendency","Number of Answers"],["Item one", 2],["Item two", 5]]

This is the code I use to pass the data:

function Graph(data){
var chart = Ti.UI.createWebView({
    url: "/results.html",
    width: Ti.UI.SIZE,
    height: "auto",
    top: 110
});

for (var i=0, l=data.length; i<l; i++){
    if (data[i] instanceof Array) data[i] = data[i].join(";");
}
var syndata = data.join("@");

chart.addEventListener('beforeload',function(e){
    chart.evalJS("var syndata ='"+syndata+"';");
});

this.chart = chart;

return;
};

module.exports = Graph;

I tried passing different kinds of data, and found that it only works with strings, so I converted the array to a string of
“Tendecy;Number of answers@Item1;2@….”
In the results.html, I convert it to an array again, and read it into the chart:

<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
var dt = syndata.split("@");
for(var i = 0, l = dt.length; i<l; i++) dt[i] = dt[i].split(";");

  google.load("visualization", "1", {packages:["corechart"]});
  function drawChart(d) {

    var data = google.visualization.arrayToDataTable(d);

    var options = {
      title: 'Overview',
      chartArea:{left:5,top:5,width:"100%",height:"100%"}
    };

    var chart = new google.visualization.PieChart(document.getElementById('chart'));
    chart.draw(data, options);
  }

  google.setOnLoadCallback(function(){ drawChart(dt) });
</script>

However, I only get a grey chart with one item saying “Other”. It works fine when I paste the array directly into the file and reference from that… I tried outputting the array with Ti.API.info directly from results.html to see if there was a mistake, but everything seems fine. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:55:58+00:00Added an answer on June 12, 2026 at 5:55 pm

    http://blog.clearlyinnovative.com/post/4044172191/titanium-appcelerator-quickie-google-charts-and

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.