Solved

How to access Chart Control in VS 2013?

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 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