Here the chart is complaining because you're trying to chart a string-type
series on the same chart as a number-type series. This is not allowed. It
looks like you simply want to format the values, but not actually change
the values themselves. For this, you can return an object with 'v', and 'f'
properties from your calc function, where the 'v' property will contain the
actual value, and the 'f' property will contain a string-formatted version
of that value. Borrowing some code from your example, it might look like
this:
calc: function (dt, row) {
  var number = dt.getValue(row, 2);
  var formatter = new google.visualization.NumberFormat({fractionDigits:2});
  return {v: number, f: formatter.formatValue(number)};
}

- Sergey


On Wed, Sep 18, 2013 at 9:22 AM, khamosh <[email protected]> wrote:

> hello every body
> I have a ComboChart with ControlWrapper, I want in my chart only I see
> the the figure on two decimal places, so I use formatter, this my code
>
>  view: {
>
>            columns: [
>
>                      {
>
>                 //transform the numbers into strings, so the steppedArea
> series will work
>
>               type: "string",
>
>               calc: function (dt, row) {
>
>                   var date = dt.getValue(row, 2);
>
>                   var formatter = 
> newgoogle.visualization.DateFormat({pattern:"dd/MM/yyyy
> HH:mm"});
>
>                   return formatter.formatValue(date);
>
>                   console.log(calc, typeof (calc));
>
>               }
>
>            },
>
>            {
>
>            type:"string",
>
>     calc: function (dt, row) {
>
>           var number = dt.getValue(row, 2);
>
>           var number = dt.getValue(row, 3);
>
>           var number = dt.getValue(row, 4);
>
>            var formatter = 
> newgoogle.visualization.NumberFormat({fractionDigits:2});
>
>           console.log(calc);
>
>            return formatter.formatValue(number);
>
>              }
>
>            },
>
>            6,7]
>
>        }
>
>
> but I have this error :
>
> One or more participants failed to draw()×
>    All series on a given axis must be of the same data type×
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/google-visualization-api.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to