ASP.NET chart: how to change the font in the chart title?

The name of my pie chart is pretty small. How to change the font size or even the font of the TITLE chart? Thanks.

+6
source share
2 answers

Here is a separate chart with a custom name:

<asp:Chart ID="Chart1" runat="server"> <Titles> <asp:Title Font="Times New Roman, 12pt, style=Bold, Italic" Name="Title1" Text="Hello World"> </asp:Title> </Titles> <series> <asp:Series ChartArea="ChartArea1" ChartType="Pie" Name="Series1"> <Points> <asp:DataPoint XValue="5" YValues="5" /> <asp:DataPoint XValue="4" YValues="4" /> <asp:DataPoint XValue="3" YValues="3" /> </Points> </asp:Series> </series> <chartareas> <asp:ChartArea Name="ChartArea1"> </asp:ChartArea> </chartareas> </asp:Chart> 
+12
source

Steve's answer is correct, as an alternative, this can be done in C # as follows:

 yourChart.Titles.Add( new Title( "Gross National Rickrolls", Docking.Top, new Font("Verdana", 8f, FontStyle.Bold), Color.Black ) ); 

Documentation for:

+17
source

Source: https://habr.com/ru/post/890645/


All Articles