Re: Multicolor ColumnChart

68 views
Skip to first unread message

Sergey Grabkovsky

unread,
Oct 16, 2012, 9:41:30 AM10/16/12
to google-c...@googlegroups.com
Hi,

You can accomplish the same type of functionality with one-dimensional data by pivoting the data and specifying the colors option on the chart. The following bit of code should demonstrate how to do that:
function drawVisualization({
  // Create and populate the data table.
  data google.visualization.arrayToDataTable([
    ['''a''b''c''d''e''f'],
    [''144780551690]]);
  // Create and draw the visualization.
  new google.visualization.ColumnChart(document.getElementById('visualization')).
      draw(data,
           {title:"Yearly Coffee Consumption by Country",
            width:600height:400,
            colors['f00''0f0''00f''ff0'],
            hAxis{title"Year"}}
      );
}


On Sunday, October 14, 2012 12:52:56 PM UTC-4, eviva65 wrote:
Hi Steve,

Have you gotten any responses for your question? I'm in the same boat. I'd like to be able to have the same capability with the columnchart because it is easier to see which data is our of specs.


On Thursday, August 16, 2012 5:55:03 PM UTC-4, Steve Heady wrote:
The "old" imagechart has one key advantage.  It allows creating column charts with ranges for colors.  This is quite effective for a variety of reasons, but showing as much data as we do in a chart, color is one of the most effective tools of communication.

https://code.google.com/apis/ajax/playground/?type=visualization#image_multicolor_bar_chart

I've added this chart to my working example, but it has a number of limitations such as having zero interaction.  Being able to set a range of value to assign color to a column chart is exactly what I'm looking for.  The biggest drawback to google charts in my experience has been title positioning and colors.  I've attached a couple examples so you can see what my application is using the same dataset.

It's a no brainer to me that a colored imagechart is more effective than having an interactive chart.  Because it's deprecated, will this support be added to ColumnChart or am I missing something?

Thanks,
Steve
Reply all
Reply to author
Forward
0 new messages