How to style ASP.Net charts in MVC 3? - asp.net

There is a basic HTML helper for generating charts in .NET, but it does not allow to specify some basic styling, position of the legend and things like that. Alternative is to generate chart in a controller using old DataVisualization.Charting namespace, but this is too hacky. I don't understand why MVC 3 does not address this issue? The charts are too basic.
THank you

The correct way is to use XML.
See here
http://weblogs.asp.net/imranbaloch/archive/2011/03/21/chart-helper-in-asp-net-mvc-3-0-with-transparent-background.aspx

Solution is to use MSCharts that were originally written for web forms. Servlets should generate chart images and serve them to calling views. This has been explained in: Charting in ASP.Net MVC 3

Related

Chat for Spring MVC webUI

I am required to show stacked bar chart in my web application. The application uses JSP with spring MVC and mysql as the backend. Please suggest any easy to use charting libraries that I can use. Just have 2 charts completely in the application and hence would be helpful to have a library that would be simple to use and render in my application via my controller api.
Thanks in advance
Well, what you really need is probably a JavaScript library, and your choice will depend on which base library you choose. I have used Dojo in the past, but have recently settled on jQuery. I think jqChart has a stacked bar chart, if I am not mistaken. I am sure there are some open source libraries for jQuery that do charting as well.
Your other option is to generate the chart as an image and post it on your page using straight img tags, but I think that's not a very optimal way of doing things now a days.

ASP.NET Web Pages, WebForms or MVC?

I am thinking about using on of the technologies mentioned in the title but I can't decide which one would be the best for me. I jsut looked at asp.net to get an idea of each technology but I think I need a mix of MVC and WebForms, so that is why I am asking..
I want the MVC structure in the app itself and in the URLs
I want easily create a gridview with paging and sorting and easily map it to an SQL Database
I want to style everything easily via CSS
After I looked at asp.net I think MVC3 would be great for me but I need this in combination with WebForms, as I saw the DataGridView Control will be the best choice for my gridview.
Does someone give me some ideas what the best might be for me ?
After a long time using PHP and HTML/JS I hate it to doe every little step and using precreated Controls I only need to map to a database and customize via css would be a great enhancement to speed development things up!
Thanks!
In my opinion you should opt for MVC 3 approach (given most of your points mentioned) combined with jQuery DataTables. This gives you a best of both worlds - a great data visualiser and all the advantages of MVC 3.
DataTables
http://datatables.net/
DataTables ASP.NET MVC 3 Tutorial on CodeProject
http://www.codeproject.com/Articles/155422/jQuery-DataTables-and-ASP-NET-MVC-Integration-Part
Additionally if you didn't want to use the jQuery Data Tables you could look into MVC 3 Web grid which is the built in DataGridView equivalent for MVC:
http://msdn.microsoft.com/en-us/magazine/hh288075.aspx
You can use MVC, with aspx, Where you can also use the webforms features that you wished for.
I know there can be a flame war about this, people would suggest different suggestions.
Go for what you want.
All of what you need is possible easily in ASP.NET MVC.

Charts and Tabs ASP.NET

I am currently working on a project that is dealing with charts and tabs within an ASP.NET page. I am assigned to create a chart that will be generated from an array and a menu like system using tabs to select different options for the chart.
I have no idea how to implement this, I am using VS Web Developer 2010. I am new to ASP.NET framework and how to implement charts and tabs with this information. Basically it will be a form that the user will submit options and it will calculate a forecast of payments based on the options selected.
Please help, not sure where to even begin with ASP.NET. I have seen some things regarding AJAX controls but for some reason the controls are not loaded into VS.
For charts you can use asp.net chart control
I don't understand the part of the menu, but I think you can use the tabcontrol in the containers section of the toolbox
I'd highly recommend looking at Highcharts. It's a JavaScript library for rendering charts. It will create charts on the client-side so I'm not sure whether it meets your requirements (there are other products that support server-side generation of charts but I'm less familiar with these).
I'm not sure what you mean by using tabs for selecting different options, but Highcharts does have a lot of different rendering models and looks really good.
Take a look at their demo gallery and documentation for more information.
If you are reluctant to use client side charting solutions, try Highcharts.Net. It is a C# wrapper written around the Highcharts JS library. So you write all your code using Classes and objects in C#, and the library translates that into JS.
The added bonus is that you get to use ASP .Net's state management for data persistence. The project also has samples that can be downloaded here.
If you are using MVC, you could try out DotNet.Highcharts along with samples.

Charts generator framework from ASP.NET to HTML5

I'm working in an ASP.NET environment and i'm searching a framework (better if it is open source) which generate INTERACTIVE charts on server side. Since i have to publish this project also for mobile, i'm searching something that produces charts in HTML5.
Anyone could give me a suggestion or links about it?
Thank's so much
Marco
Try out Highcharts .Net (sample website) or DotnetHighcharts. Both are C# wrappers written around the Highcharts charting library.
The original library is in javascript, but both these projects are based entirely on C#, and you dont need to write any javascript code to get charts working. Both have sample projects, in case you are interested, although I think Highcharts .Net is more feature-complete if i'm not mistaken..
If you are looking to use MVC, DotnetHighcharts is the way to go, but if you intend to use webforms, Highcharts dot net handles viewstate for the charts so state management is no longer a headache for you..
It's not exactly what you are looking for, but might fulfil your requirements.
Have to checked out Google Chart Tools? Not to be confused with their infographics api or image charts api.
They will generate HTML5 etc dependant on what browser is used.
And can be considered semi-server-side I suppose, it will generate a portion the markup on Google's server side (n.b. not your server side), though I guessing this will depend on what chart is rendered as some charts will probably be mostly client side. However for any interactive chart a certain amount of clientside technology will be used anyway.
So I suppose it depends on if you mean server-side you mean it is essential it runs on your own server. Running on Google's infrastructure does give you the advantages of a CDN etc so it might outway the need of running on your own server.
You can use Syncfusion HTML5 chart control for your requirement. You can create chart with interactive features such as highlight date points, tooltip, exploded pie, etc., in ASP.NET environment .
Also, The HTML5 chart is using element for chart rendering. So, it is providing effective Client side interaction to the chart control. Please refer the below online document and sample link for HTML5 chart.
Documentation Link:
http://help.syncfusion.com/User%20Interface/ASP.NET/Chart%20in%20HTML5
Sample Link:
http://asp.syncfusion.com/demos/ui/chart/HTML5%20Chart/ChartAdvUserInteraction/HighlightDemo/CS/HighlightDemo.aspx
If you are interested in a commercial tool, I highly recommend Highcharts. We are using it in our commercial application. The pricing model is good--we evaluated it against FusionCharts--and it is very feature-rich, interactive.
Although commercial, you can use Highcharts under a CC license for everything except for-profit commercial apps.
its old link, But Amcharts are good option too. i used with webform and mvc applications and worked great for me.
You can use Shield UI HTML5 chart library, that will suit your requirement. I have tried it in ASP.NET environment and performs pretty well. For some examples please refer hereL https://demos.shieldui.com/aspnet/aspnet-chart/drill-down

Simple visualizations/drawings in ASP.NET

I want to generate simple drawings in my asp.net website based on some data I deal with in this application (I want to represent structure of Neural Networks). I know about existing System.Drawing namespace but Im curious if there are solutions more appropriate for asp.net.
It would be great if such visualization could be interactive (e.g. mouseover on some element displays extra infromation) but this is not necessay at the momment.
And idea or hints?
Silverlight is probably a good way to generate client-side visualizations, you can reuse most of the managed code knowledge you already have and there are several samples and controls that can help.
No solution using just System.Drawing on the server-side will allow you to have client-side interactivity (potentially if you use maps, or ajax in conjunction you could), but at that point it might make more sense to use a Rich Framework, that is unless you are an expert in javascript.

Resources