Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Google Charts: Problem in Pie chart

 
suraj savaratkar
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to Create a Pie chart using google api. I have a table named concurrent_monitoring and it contains 27 column.

I need to create a pie chart depends on number of forms are inserted in table
Here is 2 levelType and 8 ParameterName 'WC', 'PIA' and 'EPA','DPR','LAP','CB','NRM','FUN','VIB','MGMT' respectively.

I'm trying to do based on leveltype 'wc' if three form are inserted as( 'EPA','DPR','LAP') only that much displayed in the pie chart...
If forth form is inserted then pie chart shows four slice in pie chart.

I tried the following code,,





how to do please help me....
Thanks
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the code do now, and how is that different from what you expected?

I'm moving the question to a more suitable forum, as it has nothing to do with servlets.
 
suraj savaratkar
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to add the slice which only in the database i fetched data but how to assign to the chart api instead of literal value ???


 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the question is how to create a data structure in JavaScript that you can pass to arrayToDataTable? Or is it how to write Java code that can generate this JavaScript code? (I'm sort of guessing because I'm unfamiliar with the API, but then, most folks here probably are.)

What do you think you need to change, and where are you stuck making those changes? TellTheDetails.
 
suraj savaratkar
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you; join my question and helped me..

Same as I want to create a data structure in JavaScript that pass the values to arrayToDataTable coming from database..

Anybody can help me ???

If any another way please tell me !!!


 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean, "other way"? It seems you haven't tried any way (at least I'm assuming that, because you didn't answer anything to my question of what you have tried to change).

So the task -as I understand it- is to replace lines 87 - 94 by rows of your own data of two columns each; is that correct? If so, you already have the loop that iterates over the ResultSet. One major problem right now is that each loop iteration outputs vast chunks of JavaScript - the result you're getting right now must have lots of garbage in it. Each iteration of the ResultSet loop should output exactly one line of JavaScript code, namely something that looks like lines 87-94.

Or should this code create JavaScript code for several charts, one chart for each DB record? If so, is the data that goes into each chart somehow part of the DB record as well? As I said before, TellTheDetails (<-- this is a link)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic