eb表單示例
如何創建動態WebChart
private void Page_Load(object sender, System.EventArgs e) { string chartName=Request.QueryString["Chart"]; if (Session[chartName]!=null) { System.IO.MemoryStream chartStream=new System.IO.MemoryStream(); chartStream=((System.IO.MemoryStream)Session[chartName]; Response.OutputStream.Write(chartStream.ToArray(),0,(int)chartStream.Length); chartStream.Close(); Session.Remove(chartName); } }
繼續生成一些基本的HotSpot功能; 在我們原始WebForm的Form_Load事件中,我們可以添加類似于以下內容的代碼:
private void Page_Load(object sender, System.EventArgs e) { //Let's work with the Chart object for convenience Steema.TeeChart.Chart Chart1=WebChart1.Chart; //Add in a series and fill it Chart1.Aspect.View3D=false; Steema.TeeChart.Styles.Bubble bubble1=new Steema.TeeChart.Styles.Bubble(Chart1); bubble1.FillSampleValues(); //Add a SeriesToolTip to the Chart Steema.TeeChart.Tools.SeriesHotspot seriesHotSpot1=new Steema.TeeChart.Tools.SeriesHotspot(Chart1); //Steema.TeeChart.Styles.MapAction.Mark is the default value seriesHotSpot1.MapAction=Steema.TeeChart.Styles.MapAction.Mark; }
執行此代碼并將鼠標移到氣泡上將顯示系列標記的值,在本例中為YValues。 要向圖表添加縮放功能,我們需要做的就是添加一個zoomtool和一些簡單的代碼來控制縮放狀態:
private void Page_Load(object sender, System.EventArgs e) { //Let's work with the Chart object for convenience Steema.TeeChart.Chart Chart1=WebChart1.Chart; //Add in a series and fill it Chart1.Aspect.View3D=false; Steema.TeeChart.Styles.Bubble bubble1=new Steema.TeeChart.Styles.Bubble(Chart1); bubble1.FillSampleValues(); //Add a SeriesToolTip to the Chart Steema.TeeChart.Tools.SeriesHotspot seriesHotSpot1=new Steema.TeeChart.Tools.SeriesHotspot(Chart1); //Steema.TeeChart.Styles.MapAction.Mark is the default value seriesHotSpot1.MapAction=Steema.TeeChart.Styles.MapAction.Mark; //Add a ZoomTool to the Chart Steema.TeeChart.Tools.ZoomTool zoomTool1=new Steema.TeeChart.Tools.ZoomTool(Chart1); // *************** Code for zoom support *************** //check whether zoom request is being sent CheckZoom(WebChart1); } private void CheckZoom(WebChart wChart) { ArrayList zoomedState=(ArrayList)Session[wChart.ID+"Zoomed"]; zoomedState=((Steema.TeeChart.Tools.ZoomTool)wChart.Chart.Tools[0]).SetCurrentZoom(Request,zoomedState); if (zoomedState==null) Session.Remove(wChart.ID+"Zoomed"); else Session.Add(wChart.ID+"Zoomed",zoomedState); }
我們現在有一個交互式圖表,可響應鼠標懸停和鼠標點擊事件。SeriesHotSpot(在這種情況下與氣泡系列相關聯)將在鼠標移過它時顯示系列標記的值。但是,通過MapAction屬性,我們可以在鼠標移過它時自定義SeriesHotSpot的行為。例如,我們可能希望點擊其中一個氣泡將我們帶到指定的URL; 通過將MapAction屬性設置為URL,鏈接SeriesHotSpot事件并在其中指定URL,這是完全可能的:
在Page_Load事件中:
seriesHotSpot1.MapAction=Steema.TeeChart.Styles.MapAction.URL; seriesHotSpot1.GetHTMLMap +=new Steema.TeeChart.Tools.SeriesHotspotEventHandler(seriesHotSpot1_GetHTMLMap);
GetHTMLMap方法:
private void seriesHotSpot1_GetHTMLMap(Steema.TeeChart.Tools.SeriesHotspot sender, Steema.TeeChart.Tools.SeriesHotspotEventArgs e) { e.PointPolygon.Title="Go to the Steema web"; e.PointPolygon.; e.PointPolygon.Attributes="target='_blank'"; }
有效地將MapAction屬性設置為Script允許您定義您喜歡的任何行為。TeeChart為您提供了一些有用的內置腳本,可以通過HelperScripts枚舉來調用。例如,要在鼠標懸停在其中一個氣泡序列點上時打開圖像文件,我們將添加以下代碼: 在Page_Load事件中:
seriesHotSpot1.MapAction=Steema.TeeChart.Styles.MapAction.Script; seriesHotSpot1.HelperScript=Steema.TeeChart.Tools.HotspotHelperScripts.Annotation;
這里的第二行確保將相關的JavaScript添加到客戶端瀏覽器中。GetHTMLMap方法:
private void seriesHotSpot1_GetHTMLMap(Steema.TeeChart.Tools.SeriesHotspot sender, Steema.TeeChart.Tools.SeriesHotspotEventArgs e) { e.PointPolygon.Attributes=String.Format(Steema.TeeChart.Texts.HelperScriptAnnotation, "<IMG SRC=Images/myimage.jpg>"); }
進一步自定義行為只是意味著設計自己的JavaScript例程,將它們添加到客戶端瀏覽器,然后通過將它們及其參數添加到e.PointPolygon.Attributes來調用它們。
點擊了解更多下載產品最新版
↓↓↓
tml網頁源碼加密
html網頁源碼能加密嗎?能加密到何種程度?
某些時候,我們可能需要對html網頁源碼加密,使網頁源碼不那么容易被他人獲得。出于這個目標,本文測試一種html加密方式。
提前透露:結論超出預期,似乎還實現了反爬蟲。
首先來到網址:http://fairysoftware.com/html_jia_mi.html
由頁面介紹可知,這是一種使用js和escape結合實現的html加密。
直接使用頁面提供的例程,加密這一段html代碼:
得到加密的html代碼,如下圖:
然后將加密代碼粘貼到一個html文件中測試,如下圖:
頁面可以正常打開。查看網頁源碼,果然源碼是加密的,如下圖:
特別的驚喜之處是:
如上圖所示,鏈接果然消失了。
即使用開發者工具查看,也無法得到鏈接地址,而原始未加密前的html代碼中是有鏈接的,如下圖:
那么消失了的鏈接,還能正常點擊嗎?
點擊,鏈接可以正常打開:
雖然href鏈接隱藏了,但還能正常打開頁面,功能完全正常。
測試結果既驚喜又意外,這樣的html網頁加密,效果還真是不錯,值得一用。
業自動化利器-Node-RED 教程例程 200+例,直接用到項目中去。
代碼地址: han-link.cn/3707.html
#工業#
*請認真填寫需求信息,我們會在24小時內與您取得聯系。