The labels contain the plot title and the axis labels. You can set the main title for the chart using the Text property in the LabelArea class.
You can set the text, alignment, and other formatting properties for the axis labels. The label text can be bound to a datasource with the TitleDataSource and TitleDataField properties. See the following for more information:
The following example sets a title for the axis.
C# |
Copy Code
|
---|---|
YPlotArea plotArea = new YPlotArea(); plotArea.Location = new PointF(0.2f, 0.2f); plotArea.Size = new SizeF(0.6f, 0.6f); plotArea.XAxis.Title = "Categories"; plotArea.XAxis.TitleTextFont = new System.Drawing.Font("Arial", 12); plotArea.XAxis.TitleTextFill = new FarPoint.Win.Chart.SolidFill(Drawing.Color.Crimson); plotArea.YAxes[0].Title = "Values"; plotArea.YAxes[0].TitleTextFont = new System.Drawing.Font("Comic Sans MS", 12); plotArea.YAxes[0].TitleTextFill = new FarPoint.Win.Chart.SolidFill(Drawing.Color.Chartreuse); |
VB |
Copy Code
|
---|---|
Dim plotArea As New FarPoint.Win.Chart.YPlotArea() plotArea.Location = New PointF(0.2F, 0.2F) plotArea.Size = New SizeF(0.6F, 0.6F) plotArea.XAxis.Title = "Categories" plotArea.XAxis.TitleTextFont = New System.Drawing.Font("Arial", 12) plotArea.XAxis.TitleTextFill = New FarPoint.Win.Chart.SolidFill(Drawing.Color.Crimson) plotArea.YAxes(0).Title = "Values" plotArea.YAxes(0).TitleTextFont = New System.Drawing.Font("Comic Sans MS", 12) plotArea.YAxes(0).TitleTextFill = New FarPoint.Win.Chart.SolidFill(Drawing.Color.Chartreuse) |