Apply the new ASP. NET chart control on ASP.net MVC

Source: Internet
Author: User

Microsoft released a cool new ASP. NET Server Control in last November. <asp: Chart/> can be used in ASP. NET 3.5 for free and Asp.net MVC. You can see the new ASP. NET Chart Control <asp: Chart runat = "server"/>.

Download link for related resources:

  • Download the free Microsoft chart controls
  • Download the vs 2008 tool support for the chart controls
  • Download the Microsoft chart controls Samples
  • Download the Microsoft chart controls documentation

    The two pieces of this TV station are quite good.Article

    Microsoft chart controls (1)

    Microsoft chart controls (2)-How to pass through the limit value in the two tables

    Related Articles in the garden:

    ASP. NET chart controls

    I only learned today that the ASP. NET chart control has been released. An online document is attached.

  • A simple example of the. NET mschart Application

  • Say goodbye to the troubles of generating statistical charts for. Net reports

  • Here is an article that briefly introduces combining ASP. net mvc and ASP. NET charting controls.

    EditWeb. config
    Add the control namespace (Path: "<system. Web> <pages> <controls>"):

     
    <Add Tagprefix= "Asp" Namespace= "System. Web. UI. datavisualization. Charting" Assembly= "System. Web. datavisualization, version = 3.5.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35"/>
     
    Add an httphandler ("<Httphandlers>" below):
     <Add Path= "Chartimg. axd" Verb= "Get, head" Type= "System. Web. UI. datavisualization. charting. charthttphandler, system. Web. datavisualization, version = 3.5.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35" Validate= "False"/>
     
    Add the chart control to view
    <P> <% SYSTEM. Web. UI. datavisualization. charting. Chart chart2 = New System. Web. UI. datavisualization. charting. Chart (); chart2.width = 412; chart2.height = 296; chart2.rendertype = rendertype. imagetag; chart2.palette = chartcolorpalette. brightpastel; Title t New Title ( "No code behind page" , Docking. Top, New System. Drawing. Font ( "Trebuchet ms" , 14, system. Drawing. fontstyle. Bold), system. Drawing. color. fromargb (26, 59,105); chart2.titles. Add (t); chart2.chartareas. Add ( "Series 1" ); // Create a couple of Series Chart2.series. Add ( "Series 1" ); Chart2.series. Add ( "Series 2" ); // Add points to Series 1  Foreach ( Int   Value   In (List <Int >) Viewdata [ "Chart" ]) {Chart2.series [ "Series 1" ]. Points. Addy ( Value );} // Add points to Series 2  Foreach ( Int   Value   In (List < Int >) Viewdata [ "Chart" ]) {Chart2.series [ "Series 2" ]. Points. Addy ( Value + 1);} chart2.borderskin. skinstyle = borderskinstyle. emboss; chart2.bordercolor = system. drawing. color. fromargb (26, 59,105); chart2.borderlinedashstyle = chartdashstyle. solid; chart2.borderwidth = 2; chart2.legends. add ( "Legend1" ); // Render Chart Control Chart2.page = This ; Htmltextwriter writer = New Htmltextwriter (page. response. Output); chart2.rendercontrol (writer); %> </P>
     
    The effect is as follows:
     
     
     
    This articleCodeBased on ASP.net mvc rc version: mvccharting
    Streaming chart images as fileresult from MVC controllers: http://www.codeproject.com/KB/aspnet/MvcChartControlFileResult.aspx
     
    Ultimate ASP. NET: http://msdn.microsoft.com/zh-cn/magazine/dd453008.aspx with ASP. NET and LINQ charts
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.