Solved

How to access Chart Control in VS 2013?

Posted on 2014-02-16
4
4,613 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now