Can't print or copy MS Charting charts (asp:chart)
Tuesday 21 April 2009
If like me you've tried using Microsoft's latest asp.net addition, MS Charting, you may have noticed that you can print or copy and paste the charts when they are displayed. To get around this it is quite sinple, just add the below to your chart code:
- ImageStorageMode="UseImageLocation"
An example of how it would work then is:
- <asp:Chart ID="Chart1" runat="server" ImageStorageMode="UseImageLocation">
- <Titles>
- <asp:Title Name="Title1"></asp:Title>
- </Titles>
- <Series>
- <asp:Series Name="Series1" ChartType="Pie" IsValueShownAsLabel="True" IsVisibleInLegend="true">
- </asp:Series>
- </Series>
- <ChartAreas>
- <asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="true">
- <Area3DStyle Enable3D="True"></Area3DStyle>
- </asp:ChartArea>
- </ChartAreas>
- <Legends>
- <asp:Legend Name="Legend1" LegendStyle="Column"></asp:Legend>
- </Legends>
- </asp:Chart>
|
(5)
|
|
|