# Export Charts

DsExcel Java is a MESCIUS Documents product that offers a comprehensive library to create, manipulate, convert, and share Microsoft Excel-compatible spreadsheets.

## Content

In DsExcel Java, you can export charts to PDF documents. This helps in the easy generation of PDF reports from spreadsheets, like finance, sales, marketing, health care etc. Following chart types can be exported to PDF documents:

* Column Chart
* Line Chart
* Pie Chart
* Bar Chart
* Area Chart
* XY (Scatter) Chart
* Stock Chart
* Radar Chart
* Combo Chart
* Funnel Chart
* Waterfall Chart

>type=note
> **Note**: Please ensure that all the [Required Dependencies](/document-solutions/java-excel-api/docs/online/getting-started/gcexceldependencies#i-heading-required-dependencies) are added to your project.

## Using Code

Refer to the following example code to export charts in Excel files to PDF document.

```Java
//create a new workbook
Workbook workbook = new Workbook();
IWorksheet worksheet = workbook.getWorksheets().get(0);
IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 230);
worksheet.getRange("A20:D21").setValue(new Object[][] { { 100, 200, 300, 400 }, { 100, 200, 300, 400 } });
shape.getChart().getSeriesCollection().add(worksheet.getRange("A20:D21"), RowCol.Columns);
shape.getChart().getChartTitle().setText("Column Clustered Chart");
    
//save to an pdf file
workbook.save("ColumnChartPdf.pdf");
```

## Supported features

The below table shows the supported features in different chart types when exported to PDF.
**Common Features** (Supported by all Chart Types)

| **Features** | **Settings** | **Supported** |
| -------- | -------- | --------- |
| @rows=7:Chart Title | font size | Yes |
| font color | Yes |
| border | Yes |
| fill | Yes |
| overlap with plot area | No |
| custom angle | No |
| text direction | No |
| @rows=3:Plot Area | border | Yes |
| fill | Yes |
| free layout(resize) | Yes |
| @rows=15:Axes | show/hide | Yes |
| fill | Yes |
| title | Yes |
| title free layout | No |
| border | Yes |
| angle(text rotate) | No |
| max/min bounds | Yes (when min/max is auto, the rendered result might be different between MSExcel and DsExcel) |
| major/minor unit |
| horizontal axis cross position | No |
| display units | Yes |
| logrithimic scale | Yes |
| values in reverse order | Yes |
| tick marks | Yes |
| label position | Yes |
| number format | Yes |
| @rows=6:Data Label | fill | Yes |
| border | Yes |
| font | Yes |
| position | Yes |
| number format | Yes |
| contains(series name/category name/values) | Yes |
| Data Table |  | No |
| @rows=3:Error Bars | direction | Yes (There can be some differences in the exported PDF) |
| end style |
| error amount |
| @rows=4:Gridlines | major/minor | Yes |
| value axis | Yes |
| category axis | Yes |
| color | Yes |
| @rows=4:Legend | fill | Yes |
| border | Yes |
| location(top/bottom/left/right) | Yes |
| free layout(resize) | Yes |
| Trend Line |  | Yes |
| @rows=6:Series Option | primary axis | Yes |
| secondary axis | Yes |
| series overlap | Yes |
| gap width | Yes |
| fill | Yes |
| border | Yes |

### Line Chart

| Excel Export | PDF Export |
| ------------ | ---------- |
| ![LineChart GcExcel](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/linechartgcexcel.png) | ![LineChart GcPdf](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/linechartgcpdf.png) |

The below table shows the supported features in line chart type when exported to PDF.

| **Features** | **Settings** | **Supported** |
| -------- | -------- | --------- |
| @rows=9:Line | solid color | Yes |
| gradient color | No |
| weight | Yes |
| cap type | No |
| join type | No |
| dash type | Yes |
| begin arrow | No |
| end arrow | No |
| smooth line | Yes |
| @rows=3:Marker | size | Yes |
| fill | Yes |
| border | Yes |
| Drop Lines | - | No |
| High-Low Lines | - | No |
| Up-Down Bars | - | No |

### Pie Chart

| Excel Export | PDF Export |
| ------------ | ---------- |
| ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/piechartgcexcel.png) | ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/piechartgcpdf.png) |

The below table shows the supported features in pie chart type when exported to PDF.

| **Features** | **Settings** | **Supported** |
| -------- | -------- | --------- |
| @rows=2:Pie Settings | angle of first slice | Yes |
| explosion | No |
| Dought Chart | doughnut hole size | Yes |

### Bar Chart

| Excel Export | PDF Export |
| ------------ | ---------- |
| ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/barchartgcexcel.png) | ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/barchartgcpdf.png) |

The below table shows the supported features in bar chart type when exported to PDF.

| **Features** | **Settings** | **Supported** |
| -------- | -------- | --------- |
| @rows=2:Series Option | overlap | No |
| gap width | Yes |

### Scatter Chart

| Excel Export | PDF Export |
| ------------ | ---------- |
| ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/scatterchartgcexcel.png) | ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/scatterchartgcpdf.png) |

The below table shows the supported features in scatter chart type when exported to PDF.

| **Features** | **Settings** | **Supported** |
| -------- | -------- | --------- |
| @rows=7:Chart Type | scatter | Yes |
| scatter with smooth lines and markers | Yes |
| scatter with smooth lines | Yes |
| scatter with straight lines and markers | Yes |
| scatter with straight lines | Yes |
| bubble | Yes |
| 3D-bubble | No |
| @rows=2:Bubble Settings | size represents | No |
| scale bubble size | No |
| Line | smooth line | Yes |

### Stock Chart

| Excel Export | PDF Export |
| ------------ | ---------- |
| ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/stockchartgcexcel.png) | ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/stockchartgcpdf.png) |

The below table shows the supported features in stock chart type when exported to PDF.

| **Features** | **Settings** | **Supported** |
| -------- | -------- | --------- |
| @rows=7:Common Features | line color | Yes |
| stock | Yes |
| line dash type | No |
| line cap | No |
| line join | No |
| series marker | No |
| series line | No |
| @rows=4:Open-High-Low-Close | gap width | No |
| down-bar fill | Yes |
| down-bar border | No |
| up-bar | No |
| @rows=2:Volume-High-Low-Close / Volume-Open-High-Low-Close | volumn fill | Yes |
| volume border | No |

### Radar Chart

| Excel Export | PDF Export |
| ------------ | ---------- |
| ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/radarchartgcexcel.png) | ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/radarchartgcpdf.png) |

The below table shows the supported features in radar chart type when exported to PDF.

| **Features** | **Settings** | **Supported** |
| :------- | :------- | :-------- |
| @rows=2:Line | cap type | No |
| join type | No |
| @rows=3:Chart Type | radar | Yes |
| radar with markers | Yes |
| filled radar | Yes |
| @rows=2:Series Line | width | Yes |
| color | Yes |
| @rows=4:Marker | type | Yes |
| size | Yes |
| fill | Yes |
| border | Yes |

### TreeMap Chart

| Excel Export | PDF Export |
| ------------ | ---------- |
| ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/treemapgcexcel.png) | ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/treemapgcpdf.png) |

The below table shows the supported features in TreeMap chart type when exported to PDF.

| **Features** | **Settings** | **Supported** |
| -------- | -------- | --------- |
| @rows=2:Series Option | banner | No |
| overlapping | No |
| @rows=4:Label Option | contains(series name/category name/value) | No |
| number fromat | No |
| text font | Yes |
| text color | Yes |
| @rows=2:Point Formatting | fill | Yes (Only supports first level points) |
| line | No |

### Sunburst Chart

| Excel Export | PDF Export |
| ------------ | ---------- |
| ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/sunburstgcexcel.png) | ![](https://cdn.mescius.io/document-site-files/images/dd59ea42-cd61-4fa6-a018-6231c2a9c598/images/sunburstgcpdf.png) |

The below table shows the supported features in Sunburst chart type when exported to PDF.

| **Features** | **Settings** | **Supported** |
| -------- | -------- | --------- |
| Plot Area | fill | No |
| @rows=4:Label Option | contains(series name/category name/value) | No |
| number fromat | No |
| text font | Yes |
| text color | Yes |
| @rows=2:Point Formatting | fill | Yes (Only supports first level points) |
| line | Yes |

### Waterfall Chart

| **Excel Export** | **PDF Export** |
| ------------ | ---------- |
| ![image](https://cdn.mescius.io/document-site-files/images/6c089d65-4816-4591-8c0d-bb0bfb8c43df/image-20260416.eb376e.png?width=500) | ![image](https://cdn.mescius.io/document-site-files/images/6c089d65-4816-4591-8c0d-bb0bfb8c43df/image-20260416.81ca88.png?width=500) |

The below table shows the supported features in the waterfall chart type when exported to PDF.

| **Features** | **Settings** | **Supported** |
| -------- | -------- | --------- |
| @rows=3:Series options | Subtotal | Yes |
| Total | Yes |
| Connector lines | Yes |

## Limitations

The following chart types are currently not supported and the corresponding area would appear empty when exported to PDF:

* Column Chart
    * 3D Clustered
    * 3D Stacked
    * 3D 100% Stacked
    * 3D Column
* Line Chart
    * 3D Line
* Pie Chart
    * 3D Pie
    * Pie of Pie
    * Bar of Pie
* Bar Chart
    * 3D Clustered
    * 3D Stacked
    * 3D 100% Stacked
* Area Chart
    * 3D Area
    * 3D Stacked Area
    * 3D 100% Stacked Area
* Scatter Chart
    * 3D Bubble
* Map
* Surface
* Histogram
* Pareto
* Box and Whisker