OpenFlashChart之柱状图(Bar)

今天用到OpenFlashChart,作个记录:

首先到官网下载需要引入的相关文件,比如OpenFlashChart.dll和flash文件open-flash-chart-SimplifiedChinese.swf或者open-flash-chart.swf。

ContractedBlock.gif ExpandedBlockStart.gif Code
 
   
1 // 设置图表
2   var chart = new OpenFlashChart.OpenFlashChart
3 {
4 Title = { Text = " test " , Style = " color:#9ACD32;font-weight:bold;font-size:20px; " },
5 X_Axis = { GridColour = " #ffffff " , Colour = " #9ACD32 " , Labels = { Color = " #708090 " } },
6 Y_Axis = { GridColour = " #ffffff " , Colour = " #9ACD32 " , Labels = { Color = " #708090 " } },
7 Bgcolor = " #ffffff " ,
8 };
9 chart.X_Axis.SetLabels(data2);
10 chart.Y_Axis.SetRange( 0 , 100 , 5 );
11
12 // 柱状
13   var bar = new OpenFlashChart.Bar
14 {
15 Values = data,
16 DotStyleType =
17 {
18 Tip = " #x_label#<br>#val# " ,
19 DotSize = 5 ,
20 Colour = " #9ACD32 "
21 },
22 Colour = " #9ACD32 "
23 };
24 bar.Text = " 最小值 " ;
25 chart.AddElement(bar);
26
27 var bar1 = new OpenFlashChart.Bar
28 {
29 Values = data1,
30 DotStyleType =
31 {
32 Tip = " #x_label#<br>#val# " ,
33 DotSize = 5 ,
34 Colour = " #ff0000 "
35 },
36 Colour = " #ff0000 "
37 };
38 bar1.Text = " 最大值 " ;
39
40 chart.AddElement(bar1);
41
42 // 返回响应
43   Response.Clear();
44 Response.CacheControl = " no-cache " ;
45 Response.Write(chart.ToPrettyString());

JS代码:

swfobject.embedSWF("../flash/open-flash-chart-SimplifiedChinese.swf", "chartBydate", "60%", "200", "9.0.0", "expressInstall.swf", { "data-file": "chartFile/ChartByArea.aspx?param=" + param });

其他图表的使用可参见这篇:http://blog.csdn.net/liaolian9948/archive/2009/11/23/4857302.aspx

转载于:https://www.cnblogs.com/pfs1314/archive/2011/02/18/1957472.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值