Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 89339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:42:04+00:00 2026-05-10T22:42:04+00:00

Scott Gu just posted about a new set of charting controls being distributed by

  • 0

Scott Gu just posted about a new set of charting controls being distributed by the .NET team. They look incredible: http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx

The million dollar question is … will they work with MVC, and if so, when?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:42:04+00:00Added an answer on May 10, 2026 at 10:42 pm

    You can use the chart controls in two ways:

    Generating the Image from a Controller

    By generating the chart and returning it as an image from an action (as Chatuman is referring to I think):

    Chart chart = new Chart(); chart.BackColor = Color.Transparent; chart.Width = Unit.Pixel(250); chart.Height = Unit.Pixel(100);  Series series1 = new Series('Series1'); series1.ChartArea = 'ca1'; series1.ChartType = SeriesChartType.Pie; series1.Font = new Font('Verdana', 8.25f, FontStyle.Regular); series1.Points.Add(new DataPoint {                  AxisLabel = 'Value1', YValues = new double[] { value1 } }); series1.Points.Add(new DataPoint {                 AxisLabel = 'Value2', YValues = new double[] { value2 } }); chart.Series.Add(series1);  ChartArea ca1 = new ChartArea('ca1'); ca1.BackColor = Color.Transparent; chart.ChartAreas.Add(ca1);  using (var ms = new MemoryStream()) {     chart.SaveImage(ms, ChartImageFormat.Png);     ms.Seek(0, SeekOrigin.Begin);      return File(ms.ToArray(), 'image/png', 'mychart.png'); } 

    WebForms Style

    This way you just include the chart in your .aspx views (just like with traditional web forms). For this you’ll have to hook up the relevant bits in your web.config

    <controls>     ...     <add tagPrefix='asp'          namespace='System.Web.UI.DataVisualization.Charting'          assembly='System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'/> </controls>  <httpHandlers>     ...     <add path='ChartImg.axd'          verb='GET,HEAD'          validate='false'          type='System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' /> </httpHandlers>  <handlers>     ...     <add name='ChartImageHandler'          preCondition='integratedMode'           verb='GET,HEAD'          path='ChartImg.axd'          type='System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'/> </handlers> 

    You can’t run code inside the DataPoint elements when building the chart, so to hook up your data you’ll need a method in the View class. This works ok for me. Working this way makes the control render a URL to an image generated by the chart control http handler. In your deployment you’ll need to provide a writable folder for it to cache the images.

    * VS 2010 / .NET 4 Support *

    To get this working in .NET 4 you need to change the chart references to version 4.0.0.0 with the appropriate public key token.

    Also it seems that the chart control now generates urls to the current request path rather than the request route. For me this meant that all the chart requests resulted in 404 errors because /{Controller}/ChartImg.axd and equivalents were blocked by routes. To fix this I added extra IgnoreRoute calls that cover my usages – a more general solution would be better:

    public static void RegisterRoutes(RouteCollection routes) {     routes.IgnoreRoute('ChartImg.axd/{*pathInfo}');     routes.IgnoreRoute('{controller}/ChartImg.axd/{*pathInfo}');     routes.IgnoreRoute('{controller}/{action}/ChartImg.axd/{*pathInfo}'); ... 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Here is my 2 cents: Type genericType = typeof(Repository<>); Type[]… May 11, 2026 at 10:06 am
  • added an answer Well, I can share a story: Long long time ago,… May 11, 2026 at 10:06 am
  • added an answer You can peek into the information_schema schema. It has a… May 11, 2026 at 10:06 am

Related Questions

Scott Gu just posted about a new set of charting controls being distributed by
I'm using the AcceptVerbs method detailed in Scott Gu's Preview 5 blog post for
I'm reading ScottGu's blog about ASP.NET MVC, and found a lot of code cannot
I was reading http://weblogs.asp.net/scottgu/archive/2009/01/27/asp-net-mvc-1-0-release-candidate-now-available.aspx and noticed a Fantastic color scheme used to illustrate their
As Scott Myers wrote, you can take advantage of a relaxation in C++'s type-system
I was browsing Scott Hanselman's Developer Interview question list , and ran across this
recently I've been reading through Scott Meyers's excellent Effective C++ book. In one of
I have been working my way through Scott Guthrie's excellent post on ASP.NET MVC
I have been looking through Scott Guthrie's MVC tutorials and it seems like the
Last year, Scott Guthrie stated You can actually override the raw SQL that LINQ

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.