c#
  • .net
  • asp.net-mvc
  • razor
  • charts
  • 2013-07-19 147 views 1 likes 
    1

    視圖我有一個Web應用程序,我需要添加一個圖表中我的觀點:顯示在圖表中剃刀

    @{ 
        ViewBag.Title = "Travail"; 
        Layout = "~/Views/Shared/Template.cshtml"; 
    
    } 
    
        @using System.Web.Helpers; 
        @section logout { 
         <a href='@Url.Action("Retour", "Client")'><img src="~/Content/images/home-icon.png" /></a> 
         <a href='@Url.Action("Logout", "Home")' style="margin-left: 91.6%"><img src="~/Content/images/images.jpg" style="width:37px; height:37px" /></a> 
         } 
        @{ 
         var ar = new Planning.Models.Arbre(); 
         var dataView = ar.Get_List_Tache(); 
         List<string> descr = new List<string>(); 
         List<int> avance = new List<int>(); 
         foreach(Planning.Models.Tache tac in dataView){ 
          descr.Add(tac.Tache_description); 
          avance.Add(tac.Avancement); 
         } 
         Chart chartXml; 
         var filePathName = "_ChartFiles/XmlChart.xml"; 
         if (File.Exists(Server.MapPath(filePathName))) 
         { 
          chartXml = new Chart(width: 200, 
               height: 200); 
         } 
         else{ 
         chartXml = new Chart(width: 200, 
               height: 200); 
         chartXml.AddTitle("Avancement de taches"); 
         chartXml.AddSeries(
          name: "Les taches", 
          axisLabel: "Les taches", 
          xValue: descr, 
          yValues: avance); 
         chartXml.SaveXml(path: filePathName);} 
    
    
         } 
        <div>@chartXml.Write()</div> 
    

    capture 我怎樣才能在這個視圖中顯示圖表有什麼建議?

    回答

    1
    +1

    請看到我的編輯。現在的問題是模板不顯示只有圖表在這裏 –

    相關問題