Terri
Terri

Reputation: 352

highcharts with mvc C# and 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.

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/

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.

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.

Upvotes: 2

Views: 5231

Answers (2)

Sebastian Bochan
Sebastian Bochan

Reputation: 37578

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.

Further information: highcharts.com

Upvotes: 1

physics90
physics90

Reputation: 957

This is an old question, but I am looking for exactly the same thing. I just came across dotnet.highcharts. You can find the code here http://dotnethighcharts.codeplex.com. Perhaps this will work for you as well.

Upvotes: 1

Related Questions