Solved

How to access Chart Control in VS 2013?

Posted on 2014-02-16
4
4,822 Views
Last Modified: 2014-03-07
So I'm working on a web app in Visual Studio 2013. Its in VB.Net, using MVC 5. I cannot figure out how to use Chart Control in my views. It never shows up in the toolbox, and if i click to show all, it is grayed out so I can't add it into my view. What do I need to do? We were using jqPlot to implement our charts but the sponsor of the project wants the chart itself to export to excel workbooks, which I can only find working using Chart Control.
0
Comment
Question by:shanker702
  • 2
4 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39864414
You have to use Controller actions to return a chart. You cannot drag and drop it like you do in ASP.NET

Check following example

http://www.codeproject.com/Articles/125230/ASP-NET-MVC-Chart-Control
0
 
LVL 7

Expert Comment

by:Kishan Zunjare
ID: 39864481
If you need the chart in the toolbox, you can drag the dll from C:\Program Files (x86)\Microsoft Chart Controls\Assemblies (by default), to the toolbox. Or right click on the toolbar, "Choose items..."

Hope this helps.
Kishan
0
 

Author Comment

by:shanker702
ID: 39865113
When I try to import the System.Web.UI.Datavisualization.Charting into the controller, it gives me an error saying that namespace cannot be found. I've downloaded Chart Control and installed it a couple times, but its still not working.
0
 
LVL 7

Accepted Solution

by:
Kishan Zunjare earned 500 total points
ID: 39866552
The problem might be due to the fact that you are referencing the type in your view and not in your controller, in that case you probably need to define the assembly info as a web.config setting or as a page directive.

  <add assembly="System.Web.UI.DataVisualization.Charting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=<YourPublicKeyToken>(31bf3856ad364e35)"/>

Or please check;

http://blogin.codeinside.eu/2008/11/27/howto-use-the-new-aspnet-chart-controls-with-aspnet-mvc/

Hope this helps.
-Kishan
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question