コード例 #1
0
def get_chart(workbookPath, imageName="XLChart"):
    import os, time
    wbPath, wbFile = os.path.split(workbookPath)
    import pythoncom
    pythoncom.CoInitialize()
    from pyxlchart import Pyxlchart
    
    ChartObj = Pyxlchart()
    ChartObj.WorkbookDirectory = wbPath
    ChartObj.WorkbookFilename = wbFile
    ChartObj.ImageFilename = imageName
    timeDir = str(time.time())
    os.makedirs(os.path.join(request.folder, 'static\\images\\temp', timeDir))
    exportFolder = os.path.join(request.folder, 'static\\images\\temp', timeDir)
    ChartObj.ExportPath =  exportFolder
    ChartObj.ReplaceWhiteSpaceChar = '_'
    ChartDetailList = ChartObj.start_export()
    ChartDetails = dict(chartdetail = ChartDetailList, webfolder = os.path.join('static/images/temp/',timeDir),osfolder = exportFolder)
    return ChartDetails
コード例 #2
0
from pyxlchart import Pyxlchart

xl = Pyxlchart()
xl.WorkbookDirectory = "D:\\"
xl.WorkbookFilename = "chart_column.xlsx"
xl.SheetName = ""
#xl.ImageFilename = "MyChart1"
xl.ExportPath = "d:\\"
xl.ChartName = ""
xl.start_export()
コード例 #3
0
ファイル: get_img.py プロジェクト: berny9015/python-1
from pyxlchart import Pyxlchart
xl = Pyxlchart()
xl.WorkbookDirectory = "D:\\"
xl.WorkbookFilename = "chart_column.xlsx"
xl.SheetName = ""
#xl.ImageFilename = "MyChart1"
xl.ExportPath = "d:\\"
xl.ChartName = ""
xl.start_export()