高图表和MVC:如何使用 JSON 加载整个图定义和数据?
我想知道如何加载选项和数据图或返回 JSON 对象的整个图结构?
特别是,我想用 JSON 动态创建选项、类别、轴、数据等;我认为这是可能的,但我只找到描述如何加载数据的信息&系列,而不是选项。
例如,我想定义标题,xAxis等,返回一个JSon对象:
[...]
title: {
text: 'Total fruit consumtion, grouped by gender'
},
xAxis: {
categories: []
},
[...]
特别是,我需要动态创建一个更复杂的图表,类似于这个: http://www.highcharts.com/demo/column-stacked-and-grouped
提前致谢!
I'd like to know how it is possible to load options & data graph or whole graph structure returning a JSON object?
In particular, I'd like to dynamically create options, categories, axis, data, etc. with JSON; I think it is possible, but I only found informations describing how to load data& series, not options.
For example, I'd like to define title, xAxis, etc, returning a JSon Object:
[...]
title: {
text: 'Total fruit consumtion, grouped by gender'
},
xAxis: {
categories: []
},
[...]
In particular, I need to dynamically create a more complex graph, similar to this one: http://www.highcharts.com/demo/column-stacked-and-grouped
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 DotNet.Highcharts 可以根据需要在服务器端创建图表,而无需使用 JavaScript 或 JSON。以下是您希望使用该库执行的示例:
您可以在此处找到大量 ASP.NET MVC 示例:http://dotnethighcharts.codeplex.com/releases/view/80650
With DotNet.Highcharts is possible to create the chart on the server side as you like without using JavaScript or JSON. Here is the example which you would like do with the library:
You can find a lot of ASP.NET MVC examples here: http://dotnethighcharts.codeplex.com/releases/view/80650