How to set category axis

Possible Usage Scenarios

After you create a chart in a worksheet, you can then set the category axis for it. In this article, we will show you how to set the category axis for an Excel chart, using Aspose.Cells, with sample code.

The steps in sample code

  1. Create a new workbook.
  2. Create a new chart in the first worksheet.
  3. Add some values to cells in the first worksheet.
  4. Now you can set the category axis. There are two ways: using cell data or using strings directly; both are shown in the sample code.
  5. Set the value axis and save the workbook to view the result.

The following sample code generates the output Excel file.

Sample Code