Is it possible to draw charts (curves, histogram, circle) using C# via ASP.NET MVC 4 (Razor). I'm trying to make some graphics from data extracted from my Database. But, I can't find how.
Any suggestions, please ?
Thanks a lot !
Is it possible to draw charts (curves, histogram, circle) using C# via ASP.NET MVC 4 (Razor). I'm trying to make some graphics from data extracted from my Database. But, I can't find how.
Any suggestions, please ?
Thanks a lot !
When you want to display your data in graphical form, you can use Chart helper. The Chart helper can render an image that displays data in a variety of chart types.
You can create a view having razor code for chart as follows(lets say its MyChart.cshtml).
Bar chart from Array with theme
Pie chart from Array
Pie chart from Array with theme
Bar Chart Using DB Query
You can use these chart views/PartialView where ever required as a src of image.
ex.
Chart Theams
SeriesChartType enumeration supports the following:
This is the list of names that you can pass, as strings, to the Chart helper in a Razor page.
This is Helper
Hope this will help you.
You can try amcharts with javascript. It is so useful..
https://www.amcharts.com/
You can use NVD3 charts too based on D3.js
You can use ShieldUI's MVC Charts - a complete solution working in most business cases.
There is a Chart helper, which works quite well with Razor and enables you to build charts, histograms and other graphical representations of your data quite easily.
Or you could try to use some jQuery/HTML5/Javascript library:
Highcharts is a charting library written in pure HTML5/JavaScript, offering intuitive, interactive charts to your web site or web application.
jqPlot is a plotting and charting plugin for the jQuery Javascript framework.
Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web.
There are more of them, the above ones are only some examples;