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.


-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/IPAJcnyLEvMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to