In the the System.Web.UI.DataVisualization.Charting.Chart control a font can be set by referring Font by it’s family name. How do I do something similar in code?
<asp:Chart runat="server">
<legends>
<asp:Legend Font="Microsoft Sans Serif, 8.25pt, style=Bold"/>
</legends>
</asp:Chart>
How can I do something similar in the codebehind?
chart.Legends[0].Font = Font.???("Microsoft Sans Serif, 8.25pt, style=Bold")
Use one of the constructors on the
System.Drawing.Fontclass:Make sure to include
System.Drawingto get easy access to all the related items (FontFamily,FontStyle, etc).