"BC Credit disk source for sale" ASP. NET application

Source: Internet
Author: User
Tags temporary file storage textout

BC Credit disk source for sale Q1446595067

The Teechart is WebChart Teechart Control integrated for WebForms and can be found in Toolbox in the standard teechart.net installation.

Teecahrt

1.1 Adding a chart to a form

从ToolBox中选择WebChart组件并将其拖到WebForm上并拖出到size右键单击图表以选择“Edit...”选项并打开图表编辑器使用图表编辑器,可以使用图表编辑器和属性选项,添加和修改系列和轴以及图表设计的其他特征。

The Diagram editor provides options for configuring most aspects of the diagram for the runtime, settings saved in WebForm, and for general usage of the chart editor, see Tutorials 1 and 2, using the WebChart editor in all respects with the same use of Windows Forms-based diagrams.

Teecahrt

1.2 Image format (PictureFormat)

WebChart is rendered as an image on WebForm, and the default format is PNG, but can be changed through the properties Windows PictureFormat property. For compatibility with Web pages, we recommend using PNG,JPEG or GIF format, but the Internet Explorer browser also supports bitmap. With GIF image format, GIF uses 256 color reduction, so for panchromatic reproduction it is recommended that you use one of the other image formats.

* Note: The use of GIF image formats requires authorization.

Teecahrt

1.3 Tempchart Properties

The Tempchart property can be used to select how the temporary chart should be stored before it is created and displayed on the browser page, with 4 settings available:

FileSessionCacheHttphandler

Performance is similar to all caching techniques, but disk performance may affect the positive or negative use of the ' file ' option to generate Tempchart, so that ' file ' can be the fastest option.

File: If you want to write temporary files to disk, you should use the "file" setting. By default, when you install Teechart, it creates a registry key with the temporary file location and the equivalent virtual folder name, as follows:

[HKEY_LOCAL_MACHINE \ software \ Steema software \ Teechart.net]
"Virtualshare" = "/teechartfornet"
"Sharefolder" = "C: \ Program Files \ Steema software \ Teechart for. NET v3 \ Teechartfornet"

If you accept the default installation location, the above settings will be created in the standard English language machine. Teechartnet virtual folders are created by the Teechart installer, and you can change these registry settings if you create the necessary IIS virtual share locations to reflect the new registry values. WebChart Save the file to a folder named _chart_tmp under the folder specified in the Sharefolder registry key, Teechart does not delete the temporary file, but it can automatically include a utility as a Windows scheduled task. Please check the Teechart using the current version.

Session: Is the setting for temporary file storage, which does not leave any files on the disk and deletes its own cache memory files. In some cases, it is slightly slower than a temporary disk file, and to successfully run the chart with session variables, there are two conditions that must be met:

The  must enable the session for the application. ' Enabled ' is the default behavior and can be checked in the Project Web. config file: < sessionstate mode = "InProc" InProc is the default setting, which means that the session is enabled for this application. Contains an ASPX script module to retrieve the chart from memory, the name of the ASPX script should be called ' Getchart '. Teechart provides the WebForm ASP. The net sample contains an example. To create a new Getchart module from scratch, add the new WebForm to your project (or any ASPX file), name it "Getchart", and add the following code to the Page_Load event: GetChart.aspx.cs PR ivate void Page_Load (object sender, System.EventArgs e) {string chartname=request.querystring["Chart" ]; if (session[chartname]!=null) {System.IO.MemoryStream Chartstream = new System.IO.MemoryStrea M (); Chartstream= ((System.IO.MemoryStream) session[chartname]); Response.ContentType = "image/" + "PNG"; Response.OutputStream.Write (Chartstream.toarray (), 0, (int) chartstream.length); Chartstream.close (); Session.remove (Chartname); The script restores the chart that WebChart previously saved to the session cache, which returns the chart to the browser and removes it from the cache. 

Cache: The session graph cache option is very similar in Settings, ' cache ' is a useful option because it uses a cache object that is part of an ASP. NET WebForm page, so it is easy to appear in most ASP. NET application configurations, and ' Session ' Vulnerable to administrative restrictions on certain Web servers (that is, administrators have chosen to disable session support for security reasons), the cache option requires the use of the getchart.aspx file.

Contains an ASPX script module to retrieve the chart from memory, the name of the ASPX script should be called ' Getchart '. Teechart provides the WebForm ASP. The net sample contains an example. To create a new Getchart module from scratch, add the new WebForm to your project (or any ASPX file), name it "Getchart", and add the following code to the Page_Load event: GetChart.aspx.cs

private void Page_Load (Object Sender,system.eventargs e)
{
string chartname = Request.QueryString ["Chart"];

        if(Page.Cache [chartName]!= null)        {             MemoryStream chartStream = new MemoryStream();             chartStream =((MemoryStream的)Page.Cache [chartName]);             Response.ContentType =“image /”+“png”;             Response.OutputStream.Write(chartStream.ToArray(),0,(INT)chartStream.Length);             chartStream.Close();         }     }

The script restores the chart that WebChart previously saved to the page cache, which returns the chart to the browser and removes it from the cache.

HttpHandler: Use the internal teechart (webchart) generator to restore the page's chart image, which does not generate temporary files, and does not require additional ASPX files to restore the chart (such as session and cache options). This option requires a modification to the Web. config file: Earlier version vsnet before vsnet 2010. Place the following parts anywhere between the Web. config tages:

<system.web>
<add verb = "*" Path = "teechartimggen.ashx" type = "Steema.teechart.web.teechartimggen,teechart"/>

/.. Content cut for brief. /
</system.web>

Subsequent versions of vsnet, VSNET2010 +:

<system.webServer>
<add name= "Teecharthandler" verb= "path=" Teechartimggen.ashx "type=" Steema.TeeChart.Web.TeeChartImgGen, Teechart "/>
/.. Content cut for brevity. */

</system.webServer>

Note When using TeeChart.Standard.dll, replace "Teechart" at the end of Teechart.standard.

<add name = "Teecharthandler" verb = "*" Path = "teechartimggen.ashx" type = " Steema.teechart.web.teechartimggen,teechart.standard "/>

1.4 Using Interactive chart events (the AutoPostBack property is true when there is no WebChart tool in the chart)

Load events and run-time interactive events that respond to a user's mouse click on a chart can be used with Teechart's webchart without special action to use drawing events such as ' Afterdraw ' to select a chart event from the Property browser event list. If the chart does not have a teechart webchart Tool (such as zoom,scroll or hotspot), you should set the AutoPostBack property to True to enable interactive (user-clicked) events. If the above tool is present, click Response is automatically activated. For interactive events, the chart responds to a user's mouse click event, sends the location of the click to the server, and the server-side code can manipulate the event. You can then encode the event that you want to use from the list of property browser events. For more information about the WebChart event, see the "Examples of events" section.

Event Example

If you want to use the Click event in WebChart, such as clickseries, make sure that you set the chart AutoPostBack to True. In the Property browser event list, you can

Teecahrt

Double-click the event you want to set the event: double-click an entry in the list to create an in-code event declaration.

private int xval;
private int yval;

    private void WebChart1_AfterDraw(object sender,Steema.TeeChart.Drawing.Graphics3D g)    {         g.TextOut(xVal,yVal,“onAfterDraw”);     }

The above event will output text to the chart at a location determined by the values of the xval and Yval variables. X and Y values can be set according to the location of the click

private void Webchart1_clickseries (object sender, Steema.TeeChart.Series s, int valueindex, System.EventArgs e)
{
Xval=s.calcxpos (ValueIndex);
Yval=s.calcypos (ValueIndex);
}

(ii) free scripted ASP applications

Another way to use WebChart in WebForm is to use Teechart as a scripted "invisible" control in a standard ASP (ASPX) page, Teechart for. NET comes with an example to demonstrate this technique. You can find it in the ASP. Teechart project, under the "diagram as an Image" Demo folder, titled "Series Type as Image" example. Teechart can freely script in ASP through the internal chart class, although it is recommended to use Tchart Windows Forms components or WebChart controls in order to take advantage of the Teechart event

2.1 Adding a chart to a script

Assuming that you use Tchart, you need to take the initial steps to set up the Teechart project:

创建新的ASP.NET Forms项目,这将创建一个WebForm页面,将其用作客户端页面。添加新的WebForm页面,此页面将不可见,将用于处理图表代码服务器端——该页面应包含对System.Windows.Forms.dll的引用。这是因为TChart组件是基于Windows.Forms的组件。按照如下和ASPStreams示例中突出显示的代码步骤,如何设置项目

2.2 Processing Flow

The client browser page (seriestypes.aspx) contains an IMG link that is an ASPX server script (showseries.aspx) image, and the Submit button on the client page invokes the server script, which contains the variables required for parameterized Serverchart processing. This button sends the variable as part of the parameter to set the ImageUrl of the Customer page chart image, and therefore returns a dynamic chart based on the processing parameters.

Teecahrt

2.3 Using Teechart for encoding

To use Teechart server code, add a using to Teechart on the script page:

Using Steema.teechart;

Then declare a variable for Tchart and create it at the beginning of the Page_Load event

Private Tchart Tchart;

    private void Page_Load(object sender, System.EventArgs e)     {         tChart=new TChart();               /* ...add Series and data, etc ... */     

2.4 Chart Search

The key code components are:

1, the client "get" instruction, which can be initiated by the submit button or otherwise, and based on the client parameters from the server "get" graph. A request for a chart can be sent as a traditional get URL line, where the parameter is passed as a URL line, or it can be done via ASP. Passing Server Control Values between Pages. The encoding that is used to invoke the server script will be on the page behind WebForms code.

In this example, the variable is taken from a different Wrbform page element and added as a parameter to the image ' Get ' url line.

private void Sendinfo ()
{
Seriestype=dropdownlist1.items[dropdownlist1.selectedindex]. ToString ();
Viewtype=checkbox1.checked.tostring ();
Image1.imageurl= "/http" +webserver/usewebServer variable for server/
+ "/teechartfornet/aspstream/processchart.aspx?seriestype="
+seriestype+ "&view=" +viewtype;
}

2. The server script receives a GET request from the client and runs its Page_Load event, if the chart can be created and the received parameters can be used to define how the chart is populated. The chart is then rendered as an image and resubmitted to the client as a stream.

private void Page_Load (object sender, System.EventArgs e)
{
Tchart=new Tchart ();
Tchart.afterdraw + = new Steema.TeeChart.TChart.PaintChartEventHandler (This.tchart_afterdraw);

        /* ...add Series and data, etc ... */         //Process Get parameters received from client         if (Request.QueryString["view"]=="False")             tChart.Aspect.View3D=false;         else             tChart.Aspect.View3D=true;         MemoryStream tempStream = new MemoryStream();         tChart.Export.Image.PNG.Save(tempStream);         Response.ContentType="Image/PNG";         Response.OutputStream.Write(tempStream.ToArray(),0,(int)tempStream.Length);         tempStream.Close();     }

2.5 Adding events

You can add chart creation events for free-scripted Teechart ASP applications by adding events after the chart is created.

private void Page_Load (object sender, System.EventArgs e)
{
Tchart=new Tchart ();
Tchart.afterdraw + = new Steema.TeeChart.TChart.PaintChartEventHandler (This.tchart_afterdraw);

        /* ...add Series and data, etc ... */         MemoryStream tempStream = new MemoryStream();         tChart.Export.Image.PNG.Save(tempStream);         Response.ContentType="Image/PNG";         Response.OutputStream.Write(tempStream.ToArray(),0,(int)tempStream.Length);         tempStream.Close();     }     private void tChart_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)     {         string tmpStr="Copyright My Organisation "+DateTime.Now.ToString();         g.TextOut(g.Chart.Width-(int)g.TextWidth(tmpStr)-5,g.Chart.Height-(int)g.TextHeight("H")-3,tmpStr);     }

The Afterdraw event code will be executed when the chart is created, in which case the related message will be included in the chart canvas when the chart is rendered as an image. If you want to use interactive events based on user mouse clicks on the client page diagram, we recommend that you use the WebChart component on WebForm.

2.6 Security Issues

The default teechart for that is installed through the Setup program. NET creates a folder and an IIS virtual folder that is sufficient to access the ASP. Teechart included. The WebForm application assumes that session support is activated in IIS to move temporary chart information. You can modify the sample project in Visual Studio.NET to use "file" as the medium for temporarily storing the chart. In a satisfying test in Windows 2000. In Windows 2003, the default installation of additional security restrictions limits the likelihood of using the default "_chart_temp" folder (the name and location of the temporary folder is configurable). In the WIN2003 server, the system administrator must modify security permissions to allow the associated ASP. NET application to save temporary files to disk.

(iii) WebChart tools

The WebChart tool can be used to add to WebChart from the editor tools palette. Many non-WebChart specific tools can be used with webcharts in addition to those that respond to mouse movements (in addition to the WebChart tools described below). All of the tool technologies described below are included in the example Teechart WebChart demo.

3.1 Hotspottool

In its simplest form, this tool activates the data point mouse hover label, which is displayed when the mouse is passed over a point. The Hotspot tool is also suitable for WinForm Charts, but the operating nature of the WebChart is therefore different, and the WebChart hotspot tools generate mapregion associated with each data point, and you can select Map operations from the following options:

标记——根据所选样式选项显示点标记URL——单击数据点时连接到URL脚本——单击数据点时运行自定义Javascript

3.2 mark--Mark

Use the style--style property to define the mark style--tag style, code:

Steema.TeeChart.Tools.SeriesHotspot Hotspottool =
((Steema.TeeChart.Tools.SeriesHotspot) webchart1.chart.tools[0]);
Hotspottool.mapaction = Steema.TeeChart.Styles.MapAction.Mark;
Hotspottool.style = Steema.TeeChart.Styles.MarksStyles.LabelPercentTotal;

3.3 URL

Use the Gethtmlmap event to set the Url,url option that is called from the data point, but the event must be encoded to set the correct URL.

Init code ....
Steema.TeeChart.Tools.SeriesHotspot Hotspottool =
((Steema.TeeChart.Tools.SeriesHotspot) webchart1.chart.tools[0]);

Hotspottool.gethtmlmap + = new Steema.TeeChart.Tools.SeriesHotspotEventHandler (HOTSPOTTOOL_GETHTMLMAP);

Event code:
private void Hotspottool_gethtmlmap (Steema.TeeChart.Tools.SeriesHotspot sender, Steema.TeeChart.Tools.SeriesHotspotEventArgs e)
{
if (checkbox1.checked)//open new window?
e.pointpolygon.attributes= "target= ' _blank '";
Else
e.pointpolygon.attributes= "target= ' _self '"; tab

 if (e.Series==WebChart1.Chart.Series[0]) e.PointPolygon.HREF="http://" + TextBox1.Text; //set URL according to textbox text + TextBox1.Text; //set URL according to textbox text  if (e.Series==WebChart1.Chart.Series[1]) e.PointPolygon.HREF="http://" + TextBox2.Text;  if (e.Series==WebChart1.Chart.Series[2]) e.PointPolygon.HREF="http://" + TextBox3.Text; + TextBox3.Text;  

}

3.4 Script

Scripting options can be used to handle any customizations or additions that you want to add to the chart by using JavaScript, and when you select a script as an option, Teechart adds the option to use the helper script, which is currently available: "Comments" (see?? Steema.TeeChart.Tools.HotspotHelperScripts), you can choose not to use Helperscript and define your own output.

protected void Page_Load (object sender, System.EventArgs e)
{

Initialization

Chart ch1 = Webchart1.chart;

Steema.TeeChart.Themes.ColorPalettes.ApplyPalette (CH1, 9);
Steema.TeeChart.Tools.SeriesHotspot hotspot1 = new Steema.TeeChart.Tools.SeriesHotspot ();
Ch1. Legend.visible = false;
Ch1. Tools.add (HOTSPOT1);
Hotspot1. MapAction = Steema.TeeChart.Styles.MapAction.Script;

Hotspot1. Gethtmlmap + = new Steema.TeeChart.Tools.SeriesHotspotEventHandler (HOTSPOT1_GETHTMLMAP);

..... etc... More init code
}

private void Hotspot1_gethtmlmap (Steema.TeeChart.Tools.SeriesHotspot sender, Steema.TeeChart.Tools.SeriesHotspotEventArgs e)
{
This example calls a Bar Series but E.series and E.pointpolygon.valueindex could be sent
As arguments for a drilldown query.

 //The prepared HelperScriptAnnotation text accepts your text as a variable for the Annotation  //In the following case it calls an aspx script to generate and return a Chart as an image  e.PointPolygon.Attributes=String.Format(Texts.HelperScriptAnnotation,                         "");  //The annotation could, alternatively, present text in the mouseover hint, eg.:  

}

The helperscriptannotation used in the example above is: Helperscriptannotation = "onmouseover = \" Showannotation (' {0} '); \ "onmouseout = \" Showannotation ("); \“”; If you want to add your own output, you can replace the call with your own code.

string myprocess = = "Onmouseover=\" showassociateddatatable (' {0} '); \ "Onmouseout=\" showassociateddatatable ("); \" ";
E.pointpolygon.attributes=string.format (Myprocess,e.pointpolygon.valueindex.tostring ());

Then, use the Showassociateddatatable method to execute the call to display the associated data table.

3.5 Scrolltool

Scrolltool the scroll bar to the bottom of the WebChart, you can set the visible part size and start position of the chart. Although you can deactivate the feature, the chart can also be dragged and scrolltool can be used in conjunction with the Hotspot tool. Adding Scrolltool using the editor automatically sets the chart to 2D and moves the lower axis to allow space for the scroll bar, which is not visible at design time. Use Viewsegmentsize and startposition in conjunction with Segmentviewunits to set the scrollable size.

Steema.TeeChart.Tools.ScrollTool Scrolltool =
((Steema.TeeChart.Tools.ScrollTool) WebChart1.Chart.Tools [0]);
Scrolltool.startposition = 30;
Scrolltool.segmentviewunits = Steema.TeeChart.Tools.ScrollToolViewUnit.percent;
Scrolltool.viewsegmentsize = 20;

3.6 Zoomtool

Zoomtool allows you to select a sub-region of the chart to be processed for zooming, you can select the area from the Mousedrag on the chart area, return the zoom coordinates to the server to stop the zoom area, and the area can be lifted by resistance in the opposite direction. To use Zoomtool, add the following methods to the page code. Using Session::

{
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);
}

Page.cache:

private void Checkzoom (WebChart wchart)
{
ArrayList zoomedstate = (ArrayList) page.cache[wchart.id + "zoomed"];
Zoomedstate = ((Steema.TeeChart.Tools.ZoomTool) wchart.chart.tools[0]). Setcurrentzoom (Request,
Zoomedstate);
if (zoomedstate = = null)
Page.Cache.Remove (wchart.id + "zoomed");
Else
PAGE.CACHE.ADD (wchart.id + "zoomed", zoomedstate);
}

Call the method at the end of the Page_Load method to pass the name of the chart you want to scale.

Checkzoom (WEBCHART1);

clicking/dragging on a chart without any mouse x or y displacement causes the Click to be sent back to the server instead of scaled if the window onload event is required.

3.7 Window OnLoad Event

When WebChart adds a zoom or scroll tool, it needs to use the Window.onload event to initialize the feature of the tool. If you need to further use the OnLoad event to suit your needs, add a new function to the page named Windowonload and put the code there. For example. In the page's

Part of

<script language = javascript>
function Windowonload ()
{
Window.status = new Date (). GetTime ();
}
</script>

"BC Credit disk source for sale" ASP. NET application

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.