How to use Chart Control in EP 2009?
ASP.NET Chart Control
(1) Install the components
Chart Controls for .NET Framework
Chart Controls Add-on for Visual Studio 2008
(2) MODIFY WEB.CONFIG
Add the below as the child node to <HttpHandlers> section
<add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
Add the just after </system.web>
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
</appSettings>
Add the just before </pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</controls>
(3) Create c:\TempImageFiles folder and give read access to the app pool
Here is a sample markup for user control using Chart control ( replace the highlighted ones with your datasource control and the field or display field name)
<asp:Chart ID="Chart1" runat="server" DataMember="CustTable_Current"
DataSourceID="AxDataSource1">
<Legends>
<asp:Legend Alignment="Center" Docking="Bottom" LegendStyle="Row"
Name="Legend1">
</asp:Legend>
</Legends>
<series>
<asp:Series Legend="Legend1" Name="Open Sales Orders"
YValueMembers="openSalesOrders**" YValuesPerPoint="4">
</asp:Series>
<asp:Series ChartArea="ChartArea1" Legend="Legend1" Name="Total Sales Orders"
YValueMembers="NoSalesOrders**" YValuesPerPoint="4">
</asp:Series>
</series>
<chartareas>
<asp:ChartArea Name="ChartArea1">
<Area3DStyle Enable3D="True" />
</asp:ChartArea>
</chartareas>
</asp:Chart>
Comments
Anonymous
April 01, 2009
PingBack from http://culture.linkablez.info/2009/04/01/how-to-use-chart-control-in-ep-2009/Anonymous
September 03, 2012
Hi, Thanks for this post. I did the way which you have explained. But after adding the user control page in an Enterprise Portal am getting the error as Unable to load content ChartDiagram. Please contact your system administrator. Could you please tell me how to rectify this error? Please... Thanks, Kannan