Question about Formatters

25 views
Skip to first unread message

dennis williamson

unread,
Nov 14, 2011, 8:11:12 PM11/14/11
to Google Visualization API
I have attempted, without success, to use the BarFormat and
NumberFormat features in the formatters with the initiation of a
BarChart.

The only way they seem to work is through the loading of the 'Table'
package and the Table() constructor. This works on a bar graph, but
has the characteristics of a table. I believe that I can improve the
appearance somewhat to make it acceptable to the users as-is. But I
spent a LOT of time trying to get the BarFormat to work with a
BarChart. This misnomer is extremely confusing and should somehow be
fixed.

Roni Biran

unread,
Nov 15, 2011, 7:05:51 AM11/15/11
to google-visua...@googlegroups.com
Hi Dennis,

As far as I know, these formatters are table cell based formatters, although I know you can format numbers and patterns to a datatable.

You are more than welcome to contact visualization team and ask them in person (I believe that you are more connected then us :-))



--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.


Dennis Williamson

unread,
Nov 15, 2011, 12:54:00 PM11/15/11
to google-visua...@googlegroups.com
thanks for the feedback Roni.  I'm a little concerned that I lost the hover capability upon conversion from BarChart to Table.  Perhaps I can use the css option to make it work.

I will contact the team.  Good idea.

Regards,
Dennis

asgallant

unread,
Nov 15, 2011, 1:57:38 PM11/15/11
to google-visua...@googlegroups.com
What did you want to happen with the BarChart?  Tables are a poor substitute when you need a chart, so the quick solution may be to hack around the problem rather than use Tables.

Dennis Williamson

unread,
Nov 15, 2011, 2:25:12 PM11/15/11
to google-visua...@googlegroups.com
I am attempting to build a multi-colored bar chart.  red for negative values, greeen for positive values.  I would also like to have a hover over the bars with the actual value approximated by the bar indicated (parens & red for negative and '%' formatted).

My first thought was to use the number formatter and the bar formatter.  then I discovered, that they were applicable to tables  only.  Is there a way around this?  Can I have both bar chart w/hover while useing bar & number formatters?


Regards,
Dennis


On Tue, Nov 15, 2011 at 10:57 AM, asgallant <drew_g...@abtassoc.com> wrote:
What did you want to happen with the BarChart?  Tables are a poor substitute when you need a chart, so the quick solution may be to hack around the problem rather than use Tables.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.

asgallant

unread,
Nov 15, 2011, 4:02:04 PM11/15/11
to google-visua...@googlegroups.com
NumberFormat should work with BarCharts.  The hack around the problem of different colored bars for negative and positive values is to create a DataView with 3 columns: 1 for your labels and 2 calculated columns, 1 positive values and 1 negative values.  Set the colors option array to two colors and the isStacked option to true.  You should be all set.  See example here: http://jsfiddle.net/JKZQH/

Dennis Williamson

unread,
Nov 15, 2011, 6:30:58 PM11/15/11
to google-visua...@googlegroups.com
thanx a million.  I'll give it a try....


On Tue, Nov 15, 2011 at 1:02 PM, asgallant <drew_g...@abtassoc.com> wrote:
NumberFormat should work with BarCharts.  The hack around the problem of different colored bars for negative and positive values is to create a DataView with 3 columns: 1 for your labels and 2 calculated columns, 1 positive values and 1 negative values.  Set the colors option array to two colors and the isStacked option to true.  You should be all set.  See example here: http://jsfiddle.net/JKZQH/

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
Reply all
Reply to author
Forward
0 new messages