I'm trying to create a Line chart and I get the following error:
Type mismatch. Value 364390 does not match type number in column index
0
[Break On This Error] function Mq(a,b,c){if(c!=k){var a=a[Qb...ch type
"+a+" in column index "+b))}}
I'm populating the datasource with typeof int. Do you know what's
causing this error?
Below is my code
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('number', 'Amount');
data.addRows(datasource);
var options = {
width: 800, height: 480,
title: 'Top sales'
};
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
var data = new google.visualization.DataTable(
{
cols: [{id: 'task', label: 'Task', type: 'string'},
{id: 'hours', label: 'Hours per Day', type: 'number'}],
rows: [{c:[{v: 'Work'}, {v: 11}]},
{c:[{v: 'Eat'}, {v: 2}]},
{c:[{v: 'Commute'}, {v: 2}]},
{c:[{v: 'Watch TV'}, {v:2}]},
{c:[{v: 'Sleep'}, {v:7, f:'7.000'}]}
]
},
0.6
)Thanks
On Dec 11, 1:34 pm, Antonis Panagi <antonis...@gmail.com> wrote:
> I'm using exactly the same datasource.
>
>
>
>
>
>
>
> On Sun, Dec 11, 2011 at 12:11 PM, Roni Biran <roni.bi...@gmail.com> wrote:
> > The datasource needs to be the same. Are you rendering different datatable
> > for the LineChart?
>
> > On Sun, Dec 11, 2011 at 12:07 PM, Antonis Panagi <antonis...@gmail.com>wrote:
>
> >> hehe.
>
> >> The pie chart works. The line chart is not working
>
> >> On Sun, Dec 11, 2011 at 11:47 AM, Roni Biran <roni.bi...@gmail.com>wrote:
>
> >>> So if all work fine I'm pleased...
>
> >>> On Sun, Dec 11, 2011 at 11:42 AM, Antonis Panagi <antonis...@gmail.com>wrote:
>
> >>>> Roni thanks for your reply.
> >>>> I'm using the MVC3 Razor syntax.
>
> >>>> var datasource = [];
>
> >>>> foreach(var item in Model)
> >>>> {
> >>>> <text>
> >>>> datasource.push(['...@item.TotalForMonth'])
> >>>> </text>
> >>>> }
>
> >>>> where @item.TotalForMonth is integer type
>
> >>>> I have used the same code for pie chart and pie chart works.
> >>>> Thanks
>