XLSB Formats Charts in Java
Native and high performance XLSB document charts using server-side Aspose.Cells for Java APIs, without the use of any software like Microsoft or Adobe PDF.
How to Create XLSB File Charts Using Java
In order to create XLSB file charts, we’ll use
API which is a feature-rich, powerful and easy to use charting API for Java platform. You can download its latest version directly from
and install it within your Maven-based project by adding the following configurations to the pom.xml.
Repository
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
Dependency
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cells</artifactId>
<version>version of aspose-cells API</version>
<classifier>jdk17</classifier>
</dependency>
Steps to Create XLSB Files Charts in Java
A basic document charting with
APIs can be done with just few lines of code.
- Create Workbook class object.
- Get the reference of the first worksheet.
- Add sample values to cells.
- Add a chart to the worksheet.
- Access the instance of the newly added chart.
- Setting chart data source as the range.
- Save workbook.
System Requirements
Aspose.Cells for Java supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications.
- Get latest version of Aspose.Cells for Java directly from Maven .
Create XLSB Files Chart - Java
Workbook wkb = new Workbook(); | |
// Obtaining the reference of the first worksheet | |
Worksheet wks = wkb.getWorksheets().get(0); | |
// Adding sample values to cells | |
wks.getCells().get("A2").putValue("Category1"); | |
wks.getCells().get("A3").putValue("Category2"); | |
wks.getCells().get("A4").putValue("Category3"); | |
wks.getCells().get("B1").putValue("Column1"); | |
wks.getCells().get("B2").putValue(4); | |
wks.getCells().get("B3").putValue(20); | |
wks.getCells().get("B4").putValue(50); | |
wks.getCells().get("C1").putValue("Column2"); | |
wks.getCells().get("C2").putValue(50); | |
wks.getCells().get("C3").putValue(100); | |
wks.getCells().get("C4").putValue(150); | |
// Adding a chart to the worksheet | |
int chartIndex = wks.getCharts().add(ChartType.COLUMN, 5, 0, 15, 5); | |
// Accessing the instance of the newly added chart | |
Chart chart = wks.getCharts().get(chartIndex); | |
// Setting chart data source as the range "A1:C4" | |
chart.setChartDataRange("A1:C4", true); | |
wkb.save("ColumnChart.xlsb", SaveFormat.XLSB); | |
//its simple to create pyramid chart, Bubble chart with its data source | |
// as well as Line with Data Marker Chart and creating custome chart |
Online XLSB Chart Conversion Live Demos
Convert XLSB documents charts to images right now by visiting our by visiting our Live Demos website . The live demo has the following benefits
XLSB What is XLSB File Format?
XLSB file format specifies the Excel Binary File Format, which is a collection of records and structures that specify Excel workbook content. The content can include unstructured or semi-structured tables of numbers, text, or both numbers and text, formulas, external data connections, charts and images. Unlike XLSX (which is based on Open XML file format), the XLSB represents binary Excel workbook file. XLSB files can be read and written to faster which makes them useful for working with large files. XLSB is seldom used to store workbooks as XLSX (and previously XLS) are the most common user selected file formats for saving workbooks. It can be opened by Microsoft Office 2007 and above.
Read More