2008年10月26日星期日

openflashchart 2 .net添加了一个IHttpHandler

新添加的httphanlder,使得图形可以不再需要使用单独的数据文件。
使用方式,
1,web.config中添加
<httpHandlers>
<add verb="*" path="ofc_handler.ofc" type="OpenFlashChart.WebHandler.ofcHandler, OpenFlashChart"/>
</httpHandlers>
2,在数据生成的时候,把chart的示例赋予control中的Chart属性

具体见代码。

ArrayList data1 = new ArrayList();
Random rand = new Random(DateTime.Now.Millisecond);
for (double i = 0; i < temp =" rand.Next(30);"> 20)
data1.Add(new LineDotValue(temp, "#fe0"));
else
{
data1.Add(temp);
}
}

OpenFlashChart.LineHollow line1 = new LineHollow();
line1.Values = data1;
line1.HaloSize = 0;
line1.Width = 2;
line1.DotSize = 5;

line1.Tooltip = "提示:#val#";

chart.AddElement(line1);

chart.Title = new Title("line演示");
chart.Y_Axis.SetRange(0, 35, 5);
chart.Tooltip = new ToolTip("全局提示:#val#");
chart.Tooltip.Shadow = true;
chart.Tooltip.Colour = "#e43456";
chart.Tooltip.MouseStyle = ToolTipStyle.CLOSEST;
OpenFlashChartControl1.EnableCache = false;
OpenFlashChartControl1.Chart = chart;

39 条评论:

匿名 说...

您好;
我在用您写的openflashchar .net library。觉得非常好用,但是有个缺点,我生成各种图的时候,比如pie,无法在pie上某个块加超级连接。实际上很多应用都需要点击图片的某个地方,然后链接到一个新的页面。我的联系方式wenbshen@gmail.com。如果方便,麻烦您告诉我如何解决这个问题好吗,谢谢。

匿名 说...

这个控件是对openflashchart的封装,
openflashchart好像还不支持你说的功能:-)

openflashchart的介绍见:
http://teethgrinder.co.uk/open-flash-chart-2/

另外你的邮箱是不是写错了。

匿名 说...

Hi, I don't speack Chinese, Sorry.
I'm trying to use httphandler.

I made a page wich loads a UserControl in a placeHolder.

The UserControl aspx contains the <ofc:OpenFlashChartControl ID="OpenFlashChartControl1" runat="server"></ofc:OpenFlashChartControl>
Its code behind contains the new graph ...
and i make :
OpenFlashChartControl1.chart = myChart;

So, when i load the page i have my Chart.
I made some changes in the codebehind and add a new Element in my chart

When i refreshed the page ... i didnt see any changes. (I try, cache ctrl F5, enter enter ....)

I try to .Dispose(), EnableCache false, EnableViewState False at the OpenChartControl1 ... No succes

do i made something wrong ?

匿名 说...

it seems a bug in the .net library,I'll fixed it late.
you can try this.
in your page behind file
add
Response.Clear();
Response.CacheControl = "no-cache";

匿名 说...

Thanks, but it stills not working :)
I've found an other bug i think ...

I need to color my bars, on a BarGlass graph.
So i create a List<BarGlassValue> and i made a Push of new BarGlassValue('top')
(Why a string as a value ? :o)
and after BarGlass.Values = List
... The Graph is not working.
If i change 'BarGlass' by 'Bar', it is working :)

匿名 说...

hi pysc,
both bugs have been fixed,you can get the latest code and have a try:-)

匿名 说...

Woooaaa
So many Thanks !!!
both are working :)

Now, i'm trying to make an AreaHollow (on a radar chart), but i cannot choose the filling color, just the color of the line.
Apparently this is not yet implemented ? :)
i will have a look at the source Monday maybe i could implement this by looking how it's done for others language Libs :)

Many thanks :)

匿名 说...

as to the areahollow fill color property,
I just missed it out.
Added now;)

匿名 说...

Ohhhh yeeeahhhh, THANKS !

匿名 说...

Hi, love your library, works great locally. I have the ofc handler in the web.config both locally and in the shared hosting environment. When I deploy to a shared hosting environment I get these errors:

Open Flash Chart IO ERROR Loading test data Error #2032

URL: ofc_handler.ofc?chartjson=ctl00_DefaultContent_OpenFlashChartControl1

Any suggestions for trying to troubleshoot this?

many thanks!

匿名 说...

http://forums.openflashchart.com/viewtopic.php?f=8&t=288

绝对可笑 说...

你好,sorry我的邮箱写错了,应该是wenbinshen@gmail.com,关于给pie添加超级链接的,版本1里面有的OpenFlashChart.Charts.Pie有一个link的属性,不知道到2里面为什么没有了,所以想就这个问题请教下你,另外请问可以给pie或者bar添加显示出来的value么,而不是鼠标方式去之后值才显示出来

Unknown 说...

Hi,你好
请问,在什么地方可以获取你的最新版的Library?

Unknown 说...

找着地方了;
http://openflashchart.svn.sourceforge.net/viewvc/openflashchart/version-2/dot-net-library/
但用svn没下的下来,奇怪。算了这个先不管。
另外请教一下,可以用这个控件画kpi吗?

阿飞 说...

你好,我想请教个问题,我也对openflashchart进行了封装,但是当我将封装好的控件拖入updatepanel里使用的时候,每次回发内存无法释放,一直增加,但是放在updatepanel外面的时候就没有这问题,很郁闷啊。

可以加我qq吗?我的qq是409723044。

Unknown 说...

hi,一方
我也发现,一旦将openflashchart放入updatepanel时,用个按钮提交服务器端之后,控件就消失了。
另外,在updatepanel中,是不会触发ofcHandler: IHttpHandler 的。

Unknown 说...

HI,一方
我已经对你的控件做了一点点的改动,使它能支持UPDATEPANEL,希望您能看一下,然后再主版本中加上此功能!以便此控件的不停完善!不知道你的MAIL,想就将代码贴这儿的!但不支持。希望您 能 给我MAIL。时间急。先走了!
再次感谢您的 大作!

匿名 说...

谢谢
我的邮箱
xiaoyifang198302 at gmail.com
你也可以在
http://forums.openflashchart.com/viewforum.php?f=8&sid=438928090a23113dbcb21c2fc2d13825
给出。

阿飞 说...

peter,可以交流一下flash图表的使用吗?
加qq或者email,有些问题一个人怎么也琢磨不透诶。
我的email:hongfai0afei@yahoo.com.cn
我的qq:409723044

刘守善 说...

chart.Y_Legend = new Legend("中文"); Y_Legend 属性不支持中文呀!有没有办法解决?谢谢.

匿名 说...

Y_Legend不显示中文是因为,
Legend显示的时候,是垂直方式显示的。
因为中文没有嵌入swf中,所以rotate的时候,就看不见了。

匿名 说...

请问chart.Y_Legend = new Legend("中文"); Y_Legend 属性不支持中文,这个问题如何解决呢..

匿名 说...
此评论已被作者删除。
匿名 说...

GradientFillMode 可以实现Pie的颜色渐变

匿名 说...

你好!我用了WebHandler后在vs2005(.net)里面好用,但当我发布到iis里后就不能显示了:
Open Flash Chart
IO ERROR
Loading test data
Error #2032: 流错误。

匿名 说...

接上一层,对不起!英文我看不太懂,能不能麻烦你用中文帮我解决下下,thx

匿名 说...

DEMO里的ofcHandlerWeb(.net)发布到IIS里面不能正常显示,不知道是bug还是我哪块没设置好,还望解答!

匿名 说...

楼上以及楼上的楼上:-)
添加.ofc类型的映射
下面的链接是中文的
http://msdn.microsoft.com/zh-cn/library/bb515343.aspx

匿名 说...

你好!不要意思,还是不会弄!能不能麻烦你远程帮我看看,谢谢!QQ:273396158,如果无QQ,MSN:ilczsm@163.com

匿名 说...

非常感谢!我已经搞定了!能交个朋友吗?^_^

匿名 说...

不用客气。
认识了就是朋友了。

匿名 说...

显示的flash 如何背景透明?参数在哪加?
wmode=transparent

匿名 说...

如果是用swfobject


var params = {};
params.wmode = "transparent";
swfobject.embedSWF("banner.swf", "myContent", "700", "220", "8.0.0",
"expressInstall.swf", params);


我没测过。
代码上目前好像不支持设置透明,只能设置背景颜色。

Ja 说...

你好,
我用Download openflashchar .net library 的專案執行OK,
但是部屬在 IIS時候出現#2032錯誤訊息。
參考:http://msdn.microsoft.com/en-us/library/bb515343.aspx
file-name extension in IIS 7.0 設定,
Request Path. : .ofc
Executable. : < ? >
這邊要如何設定 ?
web.config 有加
< httpHandlers>
< add verb="*" path="ofc_handler.ofc" type="OpenFlashChart.WebHandler.ofcHandler, OpenFlashChart"/>
,
另外已經加入 OpenFlashChart.Dll 參考
不知道還有哪邊需要調整?謝謝。

匿名 说...

http://xiao-yifang.blogspot.com/2009/02/openflashchart-net-library.html

Executable
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

Ja 说...

Executable 已經加上去了,
目前使用 swfobject 圖形可以正常顯示。
但是使用 OfcHandlerWeb
單一檔案 (Default.aspx)執行還是會有 Loading test data
Error #2032
This is the URL that I tried to open:ofc_handler.ofc?chartjson=OpenFlashChartControl1&ec=0
訊息。

不知道哪邊是否有遺漏,再次感謝.

匿名 说...

感觉还是配置问题。iis7下我不知道是否有“检查文件是否存在”的复选框,有的话,确信去掉了?

前进 说...

哈哈,谢谢一方,就是你说的这个原因,只要把“检查文件是否存在”的复选框去掉,就OK了,太高兴了,哈哈哈...

匿名 说...

Hi,

thank you for your great work.
Is there any possibility to place the chart in an updatepanel and it still works after a refresh?
thanks a lot.

ibram