Given the data requirements of the PieCharts, I am more surprised that your data works in a PieChart even without using a diff chart. The type of the value of a cell in the DataTable should always match the column type, so in your case, either the column needs to be a "number" type (which won't work with the PieCharts) or the data needs to be a "string" type (eg, change 3to "3").
When you call the #computeDiff function to get the new DataTable, you lose the formatted values of the "Budget" column, so in your case, you need to find an alternative solution to creating the diff data. You can use the google.visualization.data.join function to do this: var diffData = google.visualization.data.join(oldData, newData, 'full', [[0, 0]], [1], [1]); diffData.setColumnProperty(1, 'role', 'old-data'); Setting the column role property to "old-data" tells the chart to make a diff-chart. It doesn't seem to matter which data column you apply the role to - column 1 (from the first table in the join statement) is always rendered as the old data and column 2 (from the second table in the join statement) is always rendered as the new data. On Sunday, December 22, 2013 3:24:30 PM UTC-5, Sander wrote: > > Heya, > > I'm not sure if I'm doing something wrong, but I've noticed something the > normal pie charts can handle just fine, but the diff pie charts can't. > > I render pie charts from JSON data which follow the "name column, value > column" paradigm, like so: > > Budget - Amount > Stuff - 300 > Food - 100 > More - 200 > > Since these 'budgets' have ID's, I use the "v/f" format explained > here<https://developers.google.com/chart/interactive/docs/reference#DataTable>, > > to separate the ID's from the name of the budget. This is useful for > events. Please see the attached JSON data. Although this is example data, > it should work just fine. > > When I run this with a normal pie chart it works just fine. When I do this > in a diff chart (using two sets) I start getting errors: > > Uncaught Error: Type mismatch. Value 3 does not match type string in > column index 0 > > Any idea what might cause this? Is this a bug or am I doing something > wrong? > > If you need more info, let me know! > > > Sander > -- 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.
