Axis title not in bold by default for waterfall chart

Hi Team,
In waterfall chart, the axis title does not appear in bold by default, unlike other charts such as column and bubble charts.

Waterfall:
image.png (95.4 KB)

Column:
image.png (88.6 KB)

Bubble:
image.png (107.6 KB)

Attached Aspose program below:

Waterfall chart:
public static void main(String[] args) {
try {
// Create a new workbook
Workbook workbook = new Workbook();

		// Get the first worksheet
		Worksheet worksheet = workbook.getWorksheets().get(0);
		Cells cells = worksheet.getCells();

		// Add headers
		cells.get("A1").putValue("Category");
		cells.get("B1").putValue("Value");

		// Sample data for waterfall chart
		String[] categories = {"Start", "Q1 Growth", "Q2 Growth", "Q3 Loss", "Q4 Growth", "End"};
		double[] values = {100000, 25000, 32000, -15000, 28000, 0};

		// Populate data
		for (int i = 0; i < categories.length; i++) {
			cells.get(i + 1, 0).putValue(categories[i]);
			cells.get(i + 1, 1).putValue(values[i]);
		}

		// Create waterfall chart
		int chartIndex = worksheet.getCharts().add(com.aspose.cells.ChartType.WATERFALL, 5, 0, 20, 8);
		Chart chart = worksheet.getCharts().get(chartIndex);

		// Set data range for chart
		chart.getNSeries().add("B2:B7", true);
		chart.getNSeries().setCategoryData("A2:A7");

		// Configure chart appearance
		chart.getTitle().setText("Financial Waterfall Analysis");
		chart.setShowLegend(false);
		
		// Configure axes 
		chart.getCategoryAxis().getTitle().setText("Quarter");
		
		chart.getValueAxis().getTitle().setText("Sales Amount");
		chart.getValueAxis().getMajorGridLines().setVisible(true);

		// Enable and configure data labels
		chart.getNSeries().get(0).getDataLabels().setShowValue(true);
		chart.getNSeries().get(0).getDataLabels().setNumberFormat("#,##0");

		
		// Save the workbook
		workbook.save("simple_waterfall_chart_axes.xlsx", SaveFormat.XLSX);
		System.out.println("Simple waterfall chart created successfully: simple_waterfall_chart.xlsx");

	} catch (Exception e) {
		e.printStackTrace();
	}
}

Column chart:
public static void main(String[] args) {
try {
// Create a new workbook
Workbook workbook = new Workbook();

		// Get the first worksheet
		Worksheet worksheet = workbook.getWorksheets().get(0);
		Cells cells = worksheet.getCells();

		// Add headers
		cells.get("A1").putValue("Category");
		cells.get("B1").putValue("Value");

		// Sample data for column chart
		String[] categories = {"Q1", "Q2", "Q3", "Q4"};
		double[] values = {25000, 32000, 28000, 35000};

		// Populate data
		for (int i = 0; i < categories.length; i++) {
			cells.get(i + 1, 0).putValue(categories[i]);
			cells.get(i + 1, 1).putValue(values[i]);
		}

		// Create column chart
		int chartIndex = worksheet.getCharts().add(com.aspose.cells.ChartType.COLUMN, 5, 0, 20, 8);
		Chart chart = worksheet.getCharts().get(chartIndex);

		// Set data range for chart
		chart.setChartDataRange("A1:B5", true);

		// Configure chart appearance
		chart.getTitle().setText("Quarterly Sales Report");
		chart.setShowLegend(true);
		
		// Configure axes 
		chart.getCategoryAxis().getTitle().setText("Quarter");
		
		chart.getValueAxis().getTitle().setText("Sales Amount");
		chart.getValueAxis().getMajorGridLines().setVisible(true);

		// Enable and configure data labels
		chart.getNSeries().get(0).getDataLabels().setShowValue(true);
		chart.getNSeries().get(0).getDataLabels().setNumberFormat("#,##0");
		
		// Save the workbook
		workbook.save("simple_column_chart.xlsx", SaveFormat.XLSX);
		System.out.println("Simple column chart created successfully: simple_column_chart.xlsx");

	} catch (Exception e) {
		e.printStackTrace();
	}
}

Bubble Chart:
public static void main(String[] args) {
try {
// Create a new workbook
Workbook workbook = new Workbook();

		// Get the first worksheet
		Worksheet worksheet = workbook.getWorksheets().get(0);
		Cells cells = worksheet.getCells();

		// Add headers
		cells.get("A1").putValue("Product");
		cells.get("B1").putValue("Sales");
		cells.get("C1").putValue("Profit");
		cells.get("D1").putValue("Market Share");

		// Sample data for bubble chart
		// Each bubble represents: X (Sales), Y (Profit), Size (Market Share)
		String[] products = {"Product A", "Product B", "Product C", "Product D", "Product E"};
		double[] sales = {30000, 45000, 25000, 60000, 35000};
		double[] profit = {5000, 8000, 3000, 12000, 7000};
		double[] marketShare = {15, 25, 10, 30, 20};

		// Populate data
		for (int i = 0; i < products.length; i++) {
			cells.get(i + 1, 0).putValue(products[i]);
			cells.get(i + 1, 1).putValue(sales[i]);
			cells.get(i + 1, 2).putValue(profit[i]);
			cells.get(i + 1, 3).putValue(marketShare[i]);
		}

		// Create bubble chart
		int chartIndex = worksheet.getCharts().add(com.aspose.cells.ChartType.BUBBLE, 5, 0, 25, 10);
		Chart chart = worksheet.getCharts().get(chartIndex);

		// Add series for bubble chart
		// X-values: Sales (Column B), Y-values: Profit (Column C), Bubble sizes: Market Share (Column D)
		chart.getNSeries().add("B2:B6", true);
		chart.getNSeries().get(0).setXValues("B2:B6");
		chart.getNSeries().get(0).setValues("C2:C6");
		chart.getNSeries().get(0).setBubbleSizes("D2:D6");

		// Configure chart appearance
		chart.getTitle().setText("Product Performance Analysis");
		chart.setShowLegend(false);
		
		// Configure axes
		chart.getCategoryAxis().getTitle().setText("Sales ($)");
		
		chart.getValueAxis().getTitle().setText("Profit ($)");
		chart.getValueAxis().getMajorGridLines().setVisible(true);

		// Enable and configure data labels to show product names
		chart.getNSeries().get(0).getDataLabels().setShowCategoryName(true);
		chart.getNSeries().get(0).getDataLabels().setShowValue(false);
		
		// Save the workbook
		workbook.save("simple_bubble_chart.xlsx", SaveFormat.XLSX);
		System.out.println("Simple bubble chart created successfully: simple_bubble_chart.xlsx");

	} catch (Exception e) {
		e.printStackTrace();
	}
}

@Shivapriya

You’re seeing that the axis titles in a waterfall chart are not bold by default, while they are bold in column and bubble charts.

To investigate this further, could you let us know:

  • Which version of Aspose.Cells for Java you are using?
  • Which application (and version) you use to open the generated XLSX files (e.g., Microsoft Excel, LibreOffice, etc.)?
  • Whether you apply any chart style or theme (e.g., setChartStyle, setTheme) before creating the charts.

Providing these details will help us reproduce the behavior and determine whether it’s a configuration issue or a product limitation. We’ll review the information and get back to you in this thread.

@Shivapriya,

It appears that for advanced charts like Waterfall, a default layout or style is applied, which might be causing the variation in font attributes for axis titles. However, you can easily adjust this by adding a few lines of code to customize the font attributes for axis titles as per your preference. Please refer to the updated code snippet for guidance.

// Configure axes
chart.getCategoryAxis().getTitle().setText("Quarter");
chart.getCategoryAxis().getTitle().getFont().setColor(com.aspose.cells.Color.getBlack());
chart.getCategoryAxis().getTitle().getFont().setBold(true);

chart.getValueAxis().getTitle().setText("Sales Amount");
chart.getValueAxis().getTitle().getFont().setColor(com.aspose.cells.Color.getBlack());
chart.getValueAxis().getTitle().getFont().setBold(true);
chart.getValueAxis().getMajorGridLines().setVisible(true);

Hope, this helps a bit.