Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to access Chart Control in VS 2013?

Posted on 2014-02-16
4
Medium Priority
?
5,255 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 1500 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

972 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