python中的fusionexport sdk
fusionexport的Python项目详细描述
fusionexport语言sdk,支持通过python导出图表和仪表板。
安装
要安装此python包,请使用pip:
pip install fusionexport
用法
在项目中使用sdk:
fromfusionexportimportExportManager,ExportConfig
开始
从简单的图表导出开始。对于导出单个图表,只需传递图表配置,就像传递给fusioncharts构造函数一样。
fromfusionexportimportExportManager,ExportConfig# Import sdk# Instantiate the ExportConfig class and add the required configurationsexport_config=ExportConfig()export_config["chartConfig"]=[{"type":"column2d","renderAt":"chart-container","width":"600","height":"400","dataFormat":"json","dataSource":{"chart":{"caption":"Number of visitors last week","subCaption":"Bakersfield Central vs Los Angeles Topanga"},"data":[{"label":"Mon","value":"15123"},{"label":"Tue","value":"14233"},{"label":"Wed","value":"25507"}]}}]# Instantiate the ExportManager classem=ExportManager()# Call the export() method with the export config and the output locationexported_files=em.export(export_config,"./exported-charts",True)# print list of exported filesprint(exported_files)
现在运行此文件,导出的图表文件将保存在./exported-charts文件夹中。
API参考
您可以找到完整的参考here