这是为图表提供数据的代码部分(在视图中)
series: [{
type: 'pie',
name: 'Some Chart Title',
data: @Html.Raw(Json.Encode(Model))
}]
这是执行app时html源代码中的代码
series: [{
type: 'pie',
name: 'Some Chart Title',
data: [{"Label":"Item A","Value":65},{"Label":"Item B","Value":58}, {"Label":"Item C","Value":30},{"Label":"Item D","Value":60},{"Label":"Item E","Value":65}]
图表未正确显示。如何以必要的格式转换上述数据?
答案 0 :(得分:0)
在highchart website的演示中,Highcharts 3.0的格式为
series: [{
type: 'pie',
name: 'Browser share',
data: [
['Firefox', 45.0],
['IE', 26.8],
['Safari', 8.5],
['Opera', 6.2],
['Others', 0.7]
]
}]