Modifying a Chart Manually
- 3 minutes to read
After you create a chart, you can choose whether to apply one of the predefined chart layouts or specify your own layout. The ASPxSpreadsheet provides the capability to add axis titles and chart titles, show the chart legend, display gridlines, and data labels, etc.
Click it to display the Chart Tools contextual tab to modify a chart.
#Add a Chart Title
Add a title to your chart by clicking the Chart Title button in the Labels group on the Layout tab, and then selecting the chart title’s position. For example, click the Above Chart button to display the title at the top of the chart.
The image below illustrates the result.
Right-click the chart and select the Change Chart Title… item in the context menu to change the default text in the title. Specify a new chart title in the invoked Change Chart Title dialog box.
#Add Axis Titles
Display horizontal and vertical axis titles by clicking the Axis Titles button in the Labels group on the Layout tab and doing the following:
Horizontal axis title: Select the Primary Horizontal Axis Title item, and then click the Title Below Axis button.
- Vertical axis title: Select the Primary Vertical Axis Title item and then select the type of axis title (rotated, vertical or horizontal).
Right-click the chart and select the Change Horizontal Axis Title… or Change Vertical Axis Title… item in the context menu to change the default text in the axis title.
#Add a Chart Legend
Add a legend to the chart by clicking the Legend button in the Labels group on the Layout tab, and then selecting the legend’s position.
For example, click the Show Legend at the Top button to display the legend above the plot area.
#Display Data Labels
Display data values on the chart by clicking the Data Labels button in the Labels group on the Layout tab, and then selecting the data labels’s position.
#Add Gridlines
Display chart gridlines by clicking the Gridlines button in the Axes group on the Layout tab and doing one of the following:
Horizontal gridlines: Select the Primary Horizontal Gridlines item, and then select the type of gridlines.
- Vertical gridlines: Select the Primary Vertical Gridlines item, and then select the type of gridlines.
A chart with horizontal and vertical gridlines is shown below.
Note
You can create and modify a chart in code on the server side with a non-visual .NET Spreadsheet Document API library.