[visualization-api] Re: How can i set the region color for each state in United States?

2013-06-26 Thread siva kumar
If I cannot set color using string how can I achieve this?

MA - OBAMA - BLUE
NH- ROMNEY - RED
NY-OBAMA-BLUE

My data is like this

MA - OBAMA - WINNER
NH-ROMNEY-WINNER


Regards
Sivakumar

On Monday, 24 June 2013 14:28:50 UTC+5:30, siva kumar wrote:

  Hi,
 **

   
 i want to set the region color for each state in the United states like in 
 attachment file? is it possible in geochart?

 Please guide me to do that.

 Thanks Regards,

 Sivakumar.


-- 
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 post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [visualization-api] Re: How can i set the region color for each state in United States?

2013-06-26 Thread Sergey Grabkovsky
Here is an updated jsfiddle http://jsfiddle.net/ZNzZA/1/that also
transforms the data.

- Sergey


On Wed, Jun 26, 2013 at 5:36 AM, siva kumar tsivakumar1...@gmail.comwrote:

 If I cannot set color using string how can I achieve this?

 MA - OBAMA - BLUE
 NH- ROMNEY - RED
 NY-OBAMA-BLUE

 My data is like this

 MA - OBAMA - WINNER
 NH-ROMNEY-WINNER


 Regards
 Sivakumar


 On Monday, 24 June 2013 14:28:50 UTC+5:30, siva kumar wrote:

  Hi,
 **


 i want to set the region color for each state in the United states like
 in attachment file? is it possible in geochart?

 Please guide me to do that.

 Thanks Regards,

 Sivakumar.

  --
 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 post to this group, send email to
 google-visualization-api@googlegroups.com.
 Visit this group at
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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 post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.




[visualization-api] Re: How can i set the region color for each state in United States?

2013-06-25 Thread Carlos Moreira
Hi! 
I just answered a similar question in stackoverflow today. Maybe it was you?
http://stackoverflow.com/questions/17269451/how-can-i-set-the-region-color-for-each-state-in-geochart
 


Sergey solution is even more clean than mine :) 
Cheers

Segunda-feira, 24 de Junho de 2013 10:58:50 UTC+2, siva kumar escreveu:

  Hi,
 **

   
 i want to set the region color for each state in the United states like in 
 attachment file? is it possible in geochart?

 Please guide me to do that.

 Thanks Regards,

 Sivakumar.


-- 
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 post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [visualization-api] Re: How can i set the region color for each state in United States?

2013-06-25 Thread Sergey Grabkovsky
Hi Carlos, it does look like you answered the same question. Here are some
ways in which you can clean up your answer:

   1. You're using an array (ivalue) as an object, you may as well simply
   define it to be an object.
   2. You're using the addRows function to add one row at a time, when you
   could be using the addRow function so you wouldn't have to do double
   arrays. Alternatively, you could just add all the rows in one function call.
   3. If you haven't specified an alert message for a state,
   ivalue[selectedRegion] will return undefined, and since you're not
   inserting any empty strings, your check of ivalue[selectedRegion] != ''
   does nothing. You should be checking for 'truthiness' (if
   (ivalue[selectedRegion]) {...}), at least, or ideally explicitly checking
   for undefined (ivalue[selectedRegion] !== undefined).
   4. You're explicitly assigning a color to each state, which is good in
   some ways (you know exactly what the color of each state is going to be),
   but it's easy to get lost in an array of length 50, and even easier to get
   out of sync.


- Sergey


On Tue, Jun 25, 2013 at 11:49 AM, Carlos Moreira
carlostricks...@gmail.comwrote:

 Hi!
 I just answered a similar question in stackoverflow today. Maybe it was
 you?

 http://stackoverflow.com/questions/17269451/how-can-i-set-the-region-color-for-each-state-in-geochart

 Sergey solution is even more clean than mine :)
 Cheers

 Segunda-feira, 24 de Junho de 2013 10:58:50 UTC+2, siva kumar escreveu:

  Hi,
 **


 i want to set the region color for each state in the United states like
 in attachment file? is it possible in geochart?

 Please guide me to do that.

 Thanks Regards,

 Sivakumar.

  --
 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 post to this group, send email to
 google-visualization-api@googlegroups.com.
 Visit this group at
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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 post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.