Python package that convert highchart configuration into image file
Project description
highchartexport
Convert highchart configuration into an image file using export server of HighCharts, which is http://export.highcharts.com/
Installation
You can use pip command
pip install highchartexport
Example
In terminal
highchartexport --json "{\"chart\":{\"type\":\"area\"},\"series\":[{\"data\":[1,2,3,4,5,6],\"name\":\"areaplot\"}]}" --out area_chart.png
highchartexport --json "{\"chart\":{\"type\":\"area\"},\"series\":[{\"data\":[1,2,3,4,5,6],\"name\":\"areaplot\"}]}" --out area_chart.png --width 2000 --scale 2
Pass highchart json file
- For PNG image file
highchartexport --in hc_config.json --out area_chart.png --width 2000 --scale 2 --type png
- For SVG file
highchartexport --in hc_config.json --out area_chart.svg --width 2000 --scale 2 --type svg
- For SVG file with StockChart
highchartexport --in hc_config.json --out area_chart.svg --chart StockChart --width 2000 --scale 2 --type svg
- For PDF file with Map Chart
highchartexport --in hc_config.json --out area_chart.svg --chart Map --width 2000 --scale 2 --type pdf
Import in your Python program
import highchartexport as hc_export
config = {
"chart": {
"type": 'bubble',
"plotBorderWidth": 1,
"zoomType": 'xy'
},
"title": {
"text": 'Highcharts bubbles save in pdf file'
},
"series": [{
"data": [
[19, 81, 63],
[98, 5, 89],
[51, 50, 73],
],
"marker": {
"fillColor": {
"radialGradient": { "cx": 0.4, "cy": 0.3, "r": 0.7 },
"stops": [
[0, 'rgba(255,255,255,0.5)'],
[1, 'rgba(200, 200, 200, 0.8)']
]
}
}
}]
}
# use default width and scale value
hc_export.save_as_pdf(config=config, filename="bubble.pdf")
# you can pass width and scale value
hc_export.save_as_pdf(config=config, filename="bubble.pdf", width=1000, scale=4)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file highchartexport-0.0.5.tar.gz.
File metadata
- Download URL: highchartexport-0.0.5.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b32ff5bf4d204ebd8b2d195e01de004d0c618aa2de156a441f1ddb1e2b410ad
|
|
| MD5 |
2a2542628c11869065475a607b206e19
|
|
| BLAKE2b-256 |
79fce31ea31e95dd064e7db4bbe695bd9df453ed55247c1dbfde81d57d511ef0
|
File details
Details for the file highchartexport-0.0.5-py3-none-any.whl.
File metadata
- Download URL: highchartexport-0.0.5-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01f6963ecefd89f42692a0d6745c1e2cfc65d19f9ba07a609fb354e21eaba137
|
|
| MD5 |
92e46e4ea16100e6648a1e4192659b88
|
|
| BLAKE2b-256 |
726fa88e9214732b970b95c3e3dbdd7cd0708646c2de472a747ffcdaeb36041e
|