与MVC C#和SQL highcharts [英] highcharts with mvc C# and sql

查看:318
本文介绍了与MVC C#和SQL highcharts的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有检查和复查约2天(UG)和无法找到在MVC4 C / 5#模型,展示了如何设置控制器/模型,从提取数据使用Highcharts任何指导,来源,参考或文档SQL数据库。

Have checked and rechecked for about 2 days (ug) and cannot find any guide, source, reference or documentation on using Highcharts in an MVC4/5 C# model that shows how to set up the controller / model to pull data from a SQL database.

我有这个样的工作 - 输入到控制器的静态数据。 HTTP:// WWW。 nimbo.com/blog/how-to-use-highcharts-js-with-asp-net-mvc-4/

I have this sample working -- static data typed into the controller. http://www.nimbo.com/blog/how-to-use-highcharts-js-with-asp-net-mvc-4/

所有的样品(距离Highcharts和经由的NuGet可用的端口)使用静态数据。找不到任何说明一步一步用于建立数据连接并在数据的拉动,因此在图表中显示出来。它可能存在,我无法找到它。

All the samples (from Highcharts and the ports available via nuget) use static data. Can't find anything that shows a step-by-step for setting up the data connection and pulling in the data so it shows up in a chart. It may exist and I can't find it.

我有一个分贝成立。其他网页连接到数据库和工作 - 完全读/写。

I have a db set up. Other pages are connected to the db and working -- full read/write.

但基本图表的设置有我难住了。一个很好的例子(带注释/说明)如何建立连接,检索数据,并成立了一个数组(S)会如此非常有益的。

But the basic chart setup has me stumped. One good example (with comments/instructions) of how to set up the connection, retrieve data, and set up an array(s) would be so very helpful.

推荐答案

您需要$ P $每年pre脚本,即返回数据为JSON,然后在JavaScript中使用 $。的getJSON( )功能,让您的数据。最后一步是使用highcharts您的数据。

You need to preapre script which i.e return data as json, then in javascript use $.getJSON() function and get your data. Last step is use your data in highcharts.

更多信息: highcharts.com

这篇关于与MVC C#和SQL highcharts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆