cavan
unread,Nov 13, 2012, 3:02:06 PM11/13/12Sign 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-visua...@googlegroups.com
Hello,
I try to chnage Y axis format and color of certain columns using setColumn function. Only one of them work, but not both of them. Here is the code
var view = new google.visualization.DataView(data);
view.setColumns([0, {
//label: chartInfo.data.getColumnLabel(1),
type: 'number',
label: 'mail',
calc: function (dt, row) {
// reformat the data in millions
return {v:dt.getValue(row, 1)/1000000, f:dt.getFormattedValue(row, 1)};
}
},
{
type: 'number',
label: 'mail',
calc: function (dt, row) { day=dt.getValue(row,0);
return (day!=2) ? dt.getValue(row, 1) : null;
}
}, {
type: 'number',
label: 'mail',
calc: function (dt, row) {day=dt.getValue(row,0);
return (day==2) ? dt.getValue(row, 1) : null;
}
}]);
So, I try to put in Y axis mln instead of six zeros and make columns different color if label is 2 or not.
If I do the following
view.setColumns([0, {
//label: chartInfo.data.getColumnLabel(1),
type: 'number',
label: 'mail',
calc: function (dt, row) {
// reformat the data in millions
return {v:dt.getValue(row, 1)/1000000, f:dt.getFormattedValue(row, 1)};
}
}
)]
The Y axis labeling works. And if I do the following
view.setColumns([0, {
type: 'number',
label: 'mail',
calc: function (dt, row) { day=dt.getValue(row,0);
return (day!=2) ? dt.getValue(row, 1) : null;
}
}, {
type: 'number',
label: 'mail',
calc: function (dt, row) {day=dt.getValue(row,0);
return (day==2) ? dt.getValue(row, 1) : null;
}
}]);
the coloring works.
I need to impose both properties.
How can it be accomplished?
Thanks in advance
cavan.