1

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();
NuminousName
  • 200
  • 1
  • 15

2 Answers2

0

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

user3373870
  • 1,406
  • 2
  • 13
  • 17
  • i dont understand, can you be more specific? – NuminousName May 01 '14 at 06:24
  • Sure, There is a control called WebBrowser in Windows Forms. If you can host an ASP.NET webpage with the Charts on a server, you can use the windows forms webbrowser control to show it. http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx – user3373870 May 01 '14 at 06:27
0

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>
  • Thak you very much to had answer my question budy, I already solved my problem by the way, I almost use the same answer you told me : the Charts are in JavaScript, and the data is loaded each second (or more) using a WebService ASP.net. thanks anyway budy ! – FrenchyBoss Oct 25 '14 at 21:01