[]
        
(Showing Draft Content)

Column Chart

Column charts are vertical versions of bar charts and use x-axis as a category axis. Column charts are preferred where number of values is too large to be used on an x-axis, while bar charts are preferred where long category titles are difficult to fit on an x-axis. For example, population share of different countries across the globe can be represented using a column chart.

DsExcel supports the following types of column charts.

Chart Type

Chart Snapshot

Use Case

Column3D

DsExcel output displays column3D chart, helping developers verify Column Chart configuration and behavior in the generated Excel workbook.

Column3D chart is used to display the chart demonstration in 3Dwhich is a modification of 2DColumn chart. It does not have a third dimension, it only looks volumetric in appearance.

ColumnClustered

DsExcel output displays column clustered chart, helping developers verify Column Chart configuration and behavior in the generated Excel workbook.

Column clustered chart is used to compare different values across different categories and show them in two-dimensional or three-dimensional vertical rectangles. This chart can be stacked normally in a regular way just like any other chart.

ColumnClustered3D

DsExcel output displays a 3D clustered column chart comparing quarterly sales for mobile phones, laptops, and tablets, helping developers verify Column Chart configuration and behavior in the generated Excel workbook.

Column clustered chart to represent the ColumnClustered chart demonstration in 3D, which looks volumetric in appearance.

ColumnStacked

DsExcel output displays columnStacked chart, helping developers verify Column Chart configuration and behavior in the generated Excel workbook.

ColumnStacked chart is used to display the relationship of specific items to the whole across different categories and plot values in two-dimensional or three-dimensional vertical rectangles. This chart stacks the data series vertically (in a vertical direction).

ColumnStacked100

DsExcel output displays columnStacked100 chart, helping developers verify Column Chart configuration and behavior in the generated Excel workbook.

ColumnStacked100 chart is used to perform comparisons of percentages that each of the values are contributing to the total, across all your categories in the spreadsheet. This chart stacks the data series vertically and also equalizes the plotted values to meet 100%. The plotted values are displayed in two-dimensional and three-dimensional rectangles.

ColumnStacked1003D

DsExcel output displays columnStacked1003D chart, helping developers verify Column Chart configuration and behavior in the generated Excel workbook.

ColumnStacked1003D is used to represent the ColumnStacked100 chart demonstration in 3D, which is a modification of 2D chart in appearance.

ColumnStacked3D

DsExcel output displays columnStacked3D chart, helping developers verify Column Chart configuration and behavior in the generated Excel workbook.

ColumnStacked3D chart is used to represent the ColumnStacked chart demonstration in 3D, which looks volumetric in appearance.

Using Code

Refer to the following example code to add Column Stacked 3D Chart:

private static void ColumnCharts() {
    // Initialize workbook
    Workbook workbook = new Workbook();
    // Fetch default worksheet
    IWorksheet worksheet = workbook.getWorksheets().get(0);
    // Prepare data for chart
    worksheet.getRange("A1:D4")
            .setValue(new Object[][] { 
                { null, "Q1", "Q2", "Q3" }, 
                { "Mobile Phones", 1330, 2345, 3493 },
                { "Laptops", 2032, 3632, 2197 }, 
                { "Tablets", 6233, 3270, 2030 } });
    worksheet.getRange("A:D").getColumns().autoFit();
    // Add Column Chart
    IShape areaChartShape = worksheet.getShapes().addChart(ChartType.Column3D, 250, 20, 360, 230);

    // Adding series to SeriesCollection
    areaChartShape.getChart().getSeriesCollection().add(worksheet.getRange("A1:D4"), RowCol.Columns, true, true);

    // Configure Chart Title
    areaChartShape.getChart().getChartTitle().getTextFrame().getTextRange().getParagraphs().add("Annual Sales Record");

    // Saving workbook to Xlsx
    workbook.save("20-ColumnChart.xlsx", SaveFileFormat.Xlsx);