this question has answer here:
i have web application , need add chart in view :
@{ 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>
how can display chart in view?any suggestions?
see chart.write
<div>@mychart.write()</div> see also: showing system.web.helpers.chart in partial view model
Comments
Post a Comment