Spread Windows Forms 14.0
Spread Windows Forms 14.0 Product Documentation / Developer's Guide / Chart Control / Understanding Charts / Labels
In This Topic
    In This Topic

    The labels contain the plot title and the axis labels.

    Plot title

    You can set the main title for the chart using the Text property in the LabelArea class.

    Axis label

    You can set the text, alignment, and other formatting properties for the axis labels. See the following for more information:

    The label text can be bound to a datasource with the TitleDataSource and TitleDataField properties.


    The following example sets the chart and axis title.

    Copy Code
    FarPoint.Win.Chart.YPlotArea plotArea = new FarPoint.Win.Chart.YPlotArea();
    plotArea.Location = new System.Drawing.PointF(0.2f, 0.2f);
    plotArea.Size = new System.Drawing.SizeF(0.6f, 0.6f);
    //Sets the Axis label
    plotArea.XAxis.Title = "Categories";
    plotArea.YAxes[0].Title = "Values";
    plotArea.YAxes[0].TitleTextDirection = FarPoint.Win.Chart.TextDirection.Rotate270Degree;
    //Sets chart title
    FarPoint.Win.Chart.LabelArea labelArea = new FarPoint.Win.Chart.LabelArea();
    labelArea.Location = new System.Drawing.PointF(0.5f, 0.02f);
    labelArea.AlignmentX = 0.5f;
    labelArea.AlignmentY = 0.0f;
    labelArea.Text = "The Chart";
    Visual Basic
    Copy Code
    Dim plotArea As New FarPoint.Win.Chart.YPlotArea()
    plotArea.Location = New System.Drawing.PointF(0.2F, 0.2F)
    plotArea.Size = New System.Drawing.SizeF(0.6F, 0.6F)
    'Sets the Axis label
    plotArea.XAxis.Title = "Categories"
    plotArea.YAxes(0).Title = "Values"
    plotArea.YAxes(0).TitleTextDirection = FarPoint.Win.Chart.TextDirection.Rotate270Degree
    'Sets chart title
    Dim labelArea As New FarPoint.Win.Chart.LabelArea()
    labelArea.Location = New System.Drawing.PointF(0.5F, 0.02F)
    labelArea.AlignmentX = 0.5F
    labelArea.AlignmentY = 0F
    labelArea.Text = "The Chart"

    Using the Chart Designer

    1. Run the Chart Designer.
    2. Expand the target Plot Area from the tree menu on the left.
    3. Select X Index Axis and set the required properties in the property list on the right.
    4. Expand Y Value Axis, select Axis0, and set the required properties in the Title section of the property list on the right.
    5. Click OK and exit Chart Designer.
    For information on starting Chart Designer, refer to Chart Designer in the SPREAD Designer Guide.
    See Also