Demos

Beginner's Guide

Charts / Gauges / Maps Guide

Customizing Charts

API

Integrating With Your Stack

Help

FusionExport Web Service fires an HTTP server to export images and data. The web service then listens to the HTTP requests sent with the required data and returns the exported chart image, data or dashboard image. FusionExport Web Service can handle requests from FusionExport CLI as well as browsers (FusionCharts library). It also allows you to save the logging statistics for each export.

Installation

Please follow the installation guide here.

API Endpoint Reference

Name Description
Endpoint /api/v1.0/export
Http Method POST
Description Does the export processing and returns the required files back to the client

Request Params

Param Name Defaults Description

stream_type

In this case the charts will be rendered and exported.
CHART-DATA / SVG / IMAGE-DATA

stream

{}

In case of SVG, it will contain the SVG string.
In case of image data, it will contain the base64 string.
In case of chart data, it may contain a JS or JSON stream containing an array of objects.

files

files.zip

Template, callback, and resource files sent as zip.
Example:
resources/
├── images/
│ ├── owl.jpg
│ ├── meow.png
├── stylesheets/
│ ├── bootstrap.css
│ └── bootstrap.min.css
├── javascripts/
│ ├── bootstrap.js
│ └── bootstrap.min.js
├── fonts/
│ ├── glyphicons-halflings-regular.eot
│ └── glyphicons-halflings-regular.woff
├── template.html
└── callbacks.js

parameters

exportfilename=FusionCharts
exportformat=png
exportactionnew=save

This will contain the output filename, format, and the action to be performed.

meta_bgColor

#FFFFFF

Background color to be used

meta_bgAlpha

Alpha value for the background

meta_DOMId

DOM Id

meta_width

Width of the chart

meta_height

Height of the chart

chart_caption

Caption or title

chart_sub_caption

Sub caption or subtitle

async_capture

false

Enables async capture

dashboard_heading

Dashboard heading

dashboard_subheading

Dashboard subheading

is_single_export

Whether it is bulk, or a single export

is_full_version

Whether it is a trial, or a paid version

user_time_zone

User timezone

log_enabled

true

Whether logging is enabled

version

Version

Name Description
Endpoint /api/v1.0/logs
Http Method POST
Description Saves the logs data into the MySQL database

Request Params

Param Name Default Description

chartType

The type of chart rendered

chartCaption

Primary caption of the chart

chartSubCaption

Sub caption of the chart

isSingleExport

Boolean true will be passed for single chart export and false for batch export

exportFileName

FusionCharts

The name of the physical file

exportFormat

png

The export format of the file

isFullVersion

This attribute will hold the value true if the product is licensed, otherwise false

userTimeZone

Time Zone of the user will be passed through this attribute.
It is in minutes, i.e. 330 for INDIA.

userIPAddress

IP address of the user

exportAction

It is used to depict download and save behavior for the export functionality

version

Version

Endpoint Http Method Query String

/api/v1.0/logs

GET

  • Key Name: sorting
    Value: <column_name>:{desc/asc},<column_name>:{desc/asc}
    Example: ?sorting=chartType:desc,userIpAdress:asc
  • Key Name: limit
    Value: <value>
    Example: ?limit=40
  • Key Name: offset
    Value: <value>
    Example: ?offset=43
  • Key Name: search
    Value: <column_name>:<value1>,<value2>
    Example: ?userIpAdress=894.320.233.231,421.232.545.134

Response

Param Name Default Description

chartType

The type of chart rendered

chartCaption

Primary caption of the chart

chartSubCaption

Sub caption of the chart

isSingleExport

Boolean true will be passed for single chart export and false for batch export.

exportFileName

FusionCharts

The name of the physical file

exportFormat

png

The export format of the file

chartOriginUrl

This will contain the URL of the origin host where the chart is embedded.
If from CLI, then origin URL would be CLI

userAgent

Contains standard browser user agent information for browser identification

isFullVersion

This attribute will hold the value true if the product is licensed otherwise false

userTimeZone

Time Zone of the user will be passed through this attribute.
It is in minutes, i.e. 330 for INDIA.

userIPAddress

IP address of the user

userCountry

Country of the user

serverDateTime

Server date time

exportAction

It is used to depict Download and Save behavior for the export functionality

version

Version

After installation, you can continue customizing the service as per your requirements. The detailed information regarding all supported configurations is listed below.

Docker Configuration

Docker configuration can be changed from .env file.

Attribute Description
APP_PORT Port number where the application should be listening
DATA_SAVE_PATH Path where the MySQL data will be stored
EXPORT_FILE_SAVE_PATH Path where the exported files will be stored

If you change any of the configuration for MySQL and RabbitMQ here, it should be reflected in the application configuration as well.

Application Configuration

Default filename: configs/fusioncharts.exporter.json

Attribute Type Description
allow_save bool Whether to allow saving of the exported files in server or not
save_path string Path to save the exported files
log_enabled bool Whether to enable logging or not
worker_count integer Number of workers to spawn

Database Configuration

Default filename: config/dbconfig.json

Attribute Type Description
username string Username for connecting to MySQL
password string Password for connecting to MySQL
database string Database for connecting to MySQL
host string Hostname where MySQL is running
port integer Port where MySQL is running

development config is used by default, production can be used if NODE_ENV is set to production.

Log (RabbitMQ) Configuration

Default filename: rabbit.json

Attribute Type Description
username string Username for connecting to rabbitmq
password string Password for connecting to rabbitmq
hostname string Hostname where rabbitmq is running
port integer Port where rabbitmq is running

Worker Pool Manager

Default filename: workerpoolmanager.json

Attribute Type Description
workerType string Whether to use phantom or chrome
minimumWorkerCount integer Number of minimum workers to spawn initially
Top