HyJavaImages Library

the java api for highcharts

Take screenshots of your web pages and JavaScript charts in Java all on the server.

The HyJavaImages library is a pure Java library that allows you to create PNG, JPEG, WEBP and PDF images of your Javascript charts on the server.
There is built-in support for Highcharts, Highcharts Stock and ApexCharts Javascript charting libraries.

The library also allows you to create an image of any web page or supplied HTML text.
This allows you to create images of charts generated using any Javascript charting library.


There are Java methods to convert:

  • Highcharts, Highcharts Stock and Apexcharts chart options to a base64 encoded image in PNG, JPEG, WEBP or PDF format
  • HTML to a base64 encoded image in PNG, JPEG, WEBP or PDF format
  • A URL to a base64 encoded image in PNG, JPEG, WEBP or PDF format

The chart options method above allows for direct integration with HyJavaCharts, HyJavaStock and HyJavaApex.
You are now able to generate Javascript charts and create an image, all from within a Java application, with no Javascript coding!

The library will start a Chrome headless server/or connect to an existing running Chrome headless server.
It then uses the DevTools Protocol to control Chrome.

There are methods to tune Chrome in high volume applications. See the Chrome.setPoolSize() method in the API.


Keep your confidential data secure. Chrome headless is running locally on your system. Your chart data used to generate the chart images does not leave your system.


// Startup Chrome headless
Chrome chrome = Chrome.getInstance();

// Generate as many chart images as needed
String base64;
ImageGenerator img = new ImageGenerator();

// Highchart png example
img.setJavaScript(LibraryType.HIGHCHARTS, null, "highcharts.js");
base64 = img.toBase64Image("{your chart options...}");

// Highstock png example
img.setJavaScript(LibraryType.HIGHCHARTS_STOCK, null, "stock/highstock.js");
base64 = img.toBase64Image("{your chart options...}");

// ApexCharts png example
img.setJavaScript(LibraryType.APEXCHARTS, null);
base64 = img.toBase64Image("{your chart options...}");

// HTML text png example
base64 = img.htmlToBase64Image("<html> your html... </html>");

// URL png example
base64 = img.toBase64Image(new URL("https://www.google.com"));

// Close down Chrome headless

Download an example Java application showing usage of the HyJavaImages library.


View the API for the HyJavaImages library.


Start a demonstration Java web application using the HyJavaImages library.


You must have Chrome 71 or later installed on your system. The library requires a Chrome version that supports the DevTools protocol v1.3.


A 30 day evaluation version of the HyJavaImages library is available to ensure the library meet your requirements.

The evaluation version is suitable for:

  • Proof of Concept testing
  • Integration testing
  • Performance testing

If you have any further questions on the library or wish to test the evaluation version, please contact our support team via the Contact Us area on the home page.

The Java API’s fully support all chart types and chart options in Highcharts v5.x, v6.x, v7.x, v8.x, v9.x;  Highcharts Stock v8.x, v9.x and ApexCharts v3.x.

Current versions supported are:




Start the HyJavaCharts demo Java web application

Start the HyJavaStock demo Java web application

Start the HyJavaApex demo Java web application

Start the HyJavaImages demo Java web application