Table of Contents
YOUR_PATH/fusionexportIf the server runs successfully, you will see the following:
pip install fusionexport
[{
"type": "column2d",
"renderAt": "chart-container",
"width": "550",
"height": "350",
"dataFormat": "json",
"dataSource": {
"chart": {
"caption": "Population Density Per Square Mile",
"subCaption": "Source: https://www.geographyrealm.com/continents-population-density/",
"theme": "fusion"
},
"data": [
{
"label": "Africa",
"value": "87"
},
{
"label": "Asia",
"value": "246"
},
{
"label": "Australia",
"value": "8.3"
},
{
"label": "Europe",
"value": "188"
},
{
"label": "North America",
"value": "57"
},
{
"label": "South America",
"value": "57"
}
]
}
}] # Import sdk
from fusionexport import ExportManager, ExportConfig
# Import json library
import json
# Load the JSON chart configuration file
chart_json_file = open('chart-config-file.json')
config = json.load(chart_json_file)
# Instantiate the ExportConfig class and add the required configurations
export_config = ExportConfig()
export_config["chartConfig"] = config
# Various options are: 'png', 'jpeg' 'pdf' and 'svg'
export_config["type"] = 'png'
# Port and host of FusionExport Service
export_server_host = "127.0.0.1"
export_server_port = 1337
# Instantiate the ExportManager class
export_manager = ExportManager(export_server_host, export_server_port)
# Call the export() method with the export_config as an argument
export_manager.export(export_config, output_dir = ".", unzip = True) python export_chart.pyThat’s it! Running the line of code above creates a file export.png containing the specified chart. Download the full source code for the FusionExport example with Python on GitHub.
To create pie charts and generate statistical data, you’ll find this list of the best…
To implement FusionCharts in a dynamically resizing flexbox layout, ensure that the chart's dimensions are…
At FusionCharts, we believe in empowering developers and businesses with cutting-edge data visualization tools that…
Ever had a data set that seemed more complicated than a Rubik's cube? You’re not…
We’ve all seen them in textbooks or presentations—those overlapping circles that simplify complex information into…
We’re excited to announce the upcoming release of FusionCharts v4.1—a groundbreaking step forward in the…