# Rendering or Saving the Chart Control to an Image

Learn how you can render or save the Chart control as an image using Spread for ASP.NET. Learn more in documentation.

## Content



You can specify how to render the Chart control as an image. The Chart control has two built-in image render classes:

*   [FileImageRender](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FileImageRender.html)
*   [HttpHandlerImageRender](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.HttpHandlerImageRender.html)

The [HttpHandlerImageRender](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.HttpHandlerImageRender.html) class should be used when the charts are easy to generate or when there will be requests for many different charts. The images can be saved to the server using a session or cache. You can specify the storage type with the [ImageTransferStorage](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.HttpHandlerImageRender.ImageTransferStorage.html) property.

The [FileImageRender](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FileImageRender.html) class renders the chart image to the client using temporary files. Since repeated requests for the same chart use the same file, this reduces the load on the server. New requests create new files as needed. Files are not cleaned up automatically. This class should be used when charts are complex and expensive to generate or when you expect a large number of requests for a small number of different charts. You can select the image type with the [ChartImageType](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.ChartImageType.html) property.

Use the [ImageRender](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.ImageRender.html) property to specify which image render class to use.

There are several server Chart events that can be used when working with a chart image:

*   [MapAreaClick](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.MapAreaClick.html)
*   [BeforeRenderMapAreas](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.BeforeRenderMapAreas.html)

The [MapAreaClick](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.MapAreaClick.html) event can be used to determine which chart element the user clicked on. Each map area on the client side corresponds to a chart element (plot area, legend, series, and so on). The [BeforeRenderMapAreas](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.BeforeRenderMapAreas.html) event can be used to customize client behavior of the map area.

The [RenderMapArea](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.RenderMapArea.html) property should be set to true to use the [MapAreaClick](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.MapAreaClick.html) event. The [HitTest](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.HitTest.html) method can be used to get information about the chart element that is clicked.

The [EnableClickEvent](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.EnableClickEvent.html) property specifies whether the [Click](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.Click.html) event fires.

The [MapAreaClick](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.MapAreaClick.html) event fires if the [RenderMapArea](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.RenderMapArea.html) property is true and the [EnableClickEvent](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.EnableClickEvent.html) property is false. If the [RenderMapArea](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.RenderMapArea.html) property is false and the [EnableClickEvent](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.EnableClickEvent.html) property is true, only the [Click](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.Click.html) event fires. If the [RenderMapArea](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.RenderMapArea.html) property is true and the [EnableClickEvent](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.EnableClickEvent.html) property is true, the [MapAreaClick](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.MapAreaClick.html) event fires if the user clicks on a chart element. The [Click](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.Click.html) event fires if the user clicks on the chart background.

The [HotSpotMode](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.HotSpotMode.html) property is used if [RenderMapArea](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.RenderMapArea.html) is true. [HotSpotMode](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.HotSpotMode.html) determines the behavior when the user clicks in a map area. The options are inactive, navigate, and post back. The inactive option is useful if you wish to display a tooltip in the map area. If the [HotSpotMode](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.HotSpotMode.html) is set to post back, the [MapAreaClick](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.MapAreaClick.html) and Client events are fired. If the [RenderMapArea](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.RenderMapArea.html) property is false, the [HotSpotMode](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.FpChart.HotSpotMode.html) property has no effect.