NA
unread,Jun 9, 2011, 4:02:45 PM6/9/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Visualization API
Hi,
I seem to be having a problem with the colors in my Treemaps. An
example is below (it can be copy and pasted into the Visualization
Playground).
Here's the situation:
- I've defined column 4 to have the same values as column 3. This
should mean that color will be assigned according to size (same size
means you get the same color).
- When you look at the treemap, Asia is bigger than America. This is
correct.
The problem is that Asia has nearly the same color as America. In
fact, if you watch the scale while moving your mouse back and forth
from America to Asia, you'll see that the color for America is a
little *higher* than that for Asia.
What's going on here? This has been confusing me for a while, and I'm
nearly convinced it's a bug.
thanks for any tips on what's happening. Snippet below.
function drawVisualization() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Location');
data.addColumn('string', 'Parent');
data.addColumn('number', 'Market trade volume (size)');
data.addColumn('number', 'Market increase/decrease (color)');
data.addRows([
["Global",null,0,0],
["America","Global",0,0],
["Europe","Global",0,0],
["Asia","Global",0,0],
["Mexico","America",1,1],
["Canada","America",3,3],
["France","Europe",20,20],
["Germany","Europe",1,1],
["China","Asia",1,1],
["Japan","Asia",2,2],
["xxx","Asia",2,2],
["yyy","Asia",2,2],
["xzzzxx","Asia",2,2],
]);
// Create and draw the visualization.
var treemap = new
google.visualization.TreeMap(document.getElementById('visualization'));
treemap.draw(data, {
minColor: 'red',
midColor: '#ddd',
maxColor: '#0d0',
headerHeight: 15,
fontColor: 'black',
showScale: true});
}