DotNet.Highcharts , Is there any way to use it in Winform application?

只愿长相守 提交于 2019-12-13 03:51:28

问题


i Recently discovered DotNet.HighCharts project, is there any way how can i use it in winform application and view the chart in webBrowser.

I tried this but its not working,

        DotNet.Highcharts.Highcharts chart = new DotNet.Highcharts.Highcharts("chart")
   .SetXAxis(new XAxis
   {
       Categories = new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }
   })
   .SetSeries(new Series
   {
       Data = new Data(new object[] { 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4 })
   }).SetTitle(new Title { Text = "12223" });




        webBrowser1.DocumentText = chart.ToHtmlString();

回答1:


Not unless you host it externally and load it inside a webBrowser control.




回答2:


Change this : webBrowser1.DocumentText = chart.ToHtmlString(); to chart1 = chart.ToHtmlString();

on the Apsx page, do this :

<head runat="server">
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title></title>
  <script src="YOURFOLDERPROJECT/jquery-1.5.1.min.js" type="text/javascript"></script>
  <script src="YOURFOLDERPROJECT/highcharts.js" type="text/javascript"></script>
  <script src="YOURFOLDERPROJECT/exporting.js" type="text/javascript"></script>
</head>
<body>
 <form id="form1" runat="server">
  <div><asp:Literal id="chart1" runat="server"></asp:Literal>
  </div>
 </form>
</body>


来源:https://stackoverflow.com/questions/23402689/dotnet-highcharts-is-there-any-way-to-use-it-in-winform-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!