I'm working with google visualization charts and I've got the following problem.
I've got a page were the charts are displayed. It's possible to switch between different charts. Every chart option works, except for the piechart.
The PieChart is visible but it just is a grey circle showing 100%.
The data i've got in the DataTable is:
{"cols": [{
"id": "New jobs",
"label": "New jobs",
"pattern": "",
"type": "string"
},
{
"id": "Date",
"label": "Date",
"pattern": "",
"type": "number"
}
],
"rows": [{"c": [{
"v": "01-11-2012",
"f": null
},{
"v": "5",
"f": null
}
]
},{"c": [{
"v": "02-11-2012",
"f": null
},{
"v": "3",
"f": null
}
]
},{"c": [{
"v": "03-11-2012",
"f": null
},{
"v": "8",
"f": null
}]
},{"c": [{
"v": "04-11-2012",
"f": null
},
{
"v": "2",
"f": null
}
]
},{"c": [{
"v": "05-11-2012",
"f": null
},
{
"v": "6",
"f": null
}
]
},{"c": [{
"v": "06-11-2012",
"f": null
},
{
"v": "7",
"f": null
}
]
}
]
}
Maybe there is something wrong with the JSON format.
Please let me know if you want more information or if you have an possible answer.
The problem has been solved.
The value was a string and it had to be a number so in PHP just cast the value to an int and then put it into the array.
{"cols": [{
"id": "New jobs",
"label": "New jobs",
"pattern": "",
"type": "string"
},
{
"id": "Date",
"label": "Date",
"pattern": "",
"type": "number"
}
],
"rows": [{"c": [{
"v": "01-11-2012",
"f": null
},{
"v": 5,
"f": null
}
]
},{"c": [{
"v": "02-11-2012",
"f": null
},{
"v": 3,
"f": null
}
]
},{"c": [{
"v": "03-11-2012",
"f": null
},{
"v": 8,
"f": null
}]
},{"c": [{
"v": "04-11-2012",
"f": null
},
{
"v": 2,
"f": null
}
]
},{"c": [{
"v": "05-11-2012",
"f": null
},
{
"v": 6,
"f": null
}
]
},{"c": [{
"v": "06-11-2012",
"f": null
},
{
"v": 7,
"f": null
}
]
}
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With