This is the default setting. It provides a fast and efficient way to render the chart images. Instead of image files, C1WebChart uses its internal HttpHandler to resolve the image URL and stream the image data directly to the client. This method requires that you to add an appropriate HttpHandler entry to the Web.Config file in the project.
C1WebChart makes this process easy by providing an option in its Confirmation dialog box when you add C1WebChart to the Web form. The Confirmation dialog box appears asking if you would like to add the HTTPHandler to the Web.config file. If you select, Yes, the following entry is added to the Web.Config file in the project:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="c1chartimage.aspx"
type="C1.Web.C1WebChart.ImageHttpHandler,C1.Web.C1WebChart.2"/>
</httpHandlers>
If your Web.Config file already contains other HttpHandlers, edit the Web.Config file directly. For example, multiple HttpHandlers are used when you include both C1WebChart and C1WebChart3D in the same application.
Note that the .xml entry contains a value that reflects the setting of the ImageUri property. If you change the value of that property and forget to update the Web.Config file, ASP.NET will at best, throw an exception, and at worst use the wrong HttpHandler. Fortunately, the error message points clearly to the HttpHandler. The easiest way to fix this problem is to modify the HTTPHanlder in the Web.Config whenever you change the ImageUri property.
The ImageUri property allows you to specify a virtual directory and file name. The virtual directory is used to store chart data when the ImageTransferMethod is set to File. The file name identifies which HttpHandler to use and should match the corresponding entry in the Web.Config file. If you leave ImageUri empty, these names are automatically manufactured by the C1WebChart and C1WebChart3D controls and are c1webchartimage.aspx and c1webchart3dimage.asp, respectively.
The following example shows the type of <img> tag that this method creates:
<img id='c1wc' src='c1webchartimage.aspx?SessionID=87987…' />
The src attribute specifies the filename associated with the HttpHandler and also a parameter that describes where the handler can find the data it needs in order to create the chart. In this case the parameter is a SessionID, but could also be a CacheID or temporary file, depending on the setting of the ImageTransferMethod property. For more information on the types of image transfer methods, see Using the Image Transfer Methods.
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |