Can't print or copy MS Charting charts (asp:chart)




Can't print or copy MS Charting charts (asp:chart)
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:
  1. ImageStorageMode="UseImageLocation" 
An example of how it would work then is:
  1. <asp:Chart ID="Chart1" runat="server" ImageStorageMode="UseImageLocation">  
  2.     <Titles>  
  3.         <asp:Title Name="Title1"></asp:Title>  
  4.     </Titles>  
  5.     <Series>  
  6.         <asp:Series Name="Series1" ChartType="Pie" IsValueShownAsLabel="True" IsVisibleInLegend="true">  
  7.         </asp:Series>  
  8.     </Series>  
  9.     <ChartAreas>  
  10.         <asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="true">  
  11. <Area3DStyle Enable3D="True"></Area3DStyle>  
  12.         </asp:ChartArea>  
  13.     </ChartAreas>  
  14.     <Legends>  
  15.         <asp:Legend Name="Legend1" LegendStyle="Column"></asp:Legend>  
  16.     </Legends>  
  17. </asp:Chart> 


5 people like this article, click here to say you like this article too (5)
Send a link to this page via email Send a link to this page