在Web应用程序使用Highcharts的JavaScript [英] Using Highcharts javascript in Web Application

查看:159
本文介绍了在Web应用程序使用Highcharts的JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跟Highcharts在我的.NET应用试验。

I am experimenting with Highcharts in my .Net application.

我有我需要包括一些数据,但似乎无法找出其中添加它。

I have some data that I need to include, but can't seem to figure out where to add it.

     /*X axis coordinates*/
     List<int> lstXaxis = new List<int>();
     lstXaxis.Add(2007);
     lstXaxis.Add(2008);
     lstXaxis.Add(2009);
     lstXaxis.Add(2010);

我需要设置公共属性,使我的as​​px页面可以访问它。

I need to setup public properties so that my aspx page can access it.

我是否包括在后面的aspx页面的C#code这两个命令?

Do I include these two commands in the C# code behind the aspx page?

      public string Series1 { get; set; }
      public string Xaxis { get; set; }

和使用该访问于x轴的数据转换?

And use the accessors to convert the x-axis data?

      JavaScriptSerializer oSerializer = new JavaScriptSerializer();
      Xaxis= oSerializer.Serialize(lstXaxis);

我引用下面的网站作为一个启动点: http://deebujacob.blogspot.com/2011/05/aspnet-and -highcharts.html

I am referencing the following site as a startup point: http://deebujacob.blogspot.com/2011/05/aspnet-and-highcharts.html

推荐答案

我发现了另一种更简单的在.NET中生成图表。想象一下,生成图表像这样;

I found another simpler for generating charts in .NET. Imagine generating charts like this;



DataTable tbl; //your datatable with chart info.. 

//the series you would like to draw, first value corresponds to the name of the column, 2nd value to the title you would to use for that chart
string[] serieslist = { "allorders,All orders", "shippedorders, Shipped orders", "rejectedorders,Rejected orders" };

//getting the chart string
string chartString = chart.DrawChart(tbl, serieslist, "yearly-report", "date", "Yearly sales report", "my subtitle", "column", false);

绘制图表3行!

Drawing a chart in 3 lines!

看这个博客输入更多信息。 <一href="http://www.phronesisweb.com/blog/using-highcharts-with-net-without-any-extra-control-generating-a-highchart-chart-in-just-one-method/" rel="nofollow">http://www.phronesisweb.com/blog/using-highcharts-with-net-without-any-extra-control-generating-a-highchart-chart-in-just-one-method/

Look at this blog enter for more info. http://www.phronesisweb.com/blog/using-highcharts-with-net-without-any-extra-control-generating-a-highchart-chart-in-just-one-method/

这篇关于在Web应用程序使用Highcharts的JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆