Bug 60915 - XLS to HTML Charts not coming
Summary: XLS to HTML Charts not coming
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.15-FINAL
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-24 11:22 UTC by pooja.dhannawat535
Modified: 2017-09-19 04:42 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pooja.dhannawat535 2017-03-24 11:22:14 UTC
I am using ExcelToHtmlConverter provided by POI to xls to pdf conversion.
Somehow in the output I am not getting charts. 

I thought of adding one more method in ExcelToHtmlConverter named as processChart by extending the class. Sample method -

 //TODO convert chart to images and add to output
    private void processChart(HSSFSheet sheet) {
        for(HSSFChart chart : HSSFChart.getSheetCharts(sheet)){
            Element table = this.htmlDocumentFacade.createTable();
            this.htmlDocumentFacade.addStyleClass(table, this.cssClassPrefixTable, "border-collapse:collapse;border-spacing:0;");
            Element tableBody = this.htmlDocumentFacade.createTableBody();
            tableBody.setTextContent(chart.getChartTitle());
            table.appendChild(tableBody);
            this.htmlDocumentFacade.getBody().appendChild(table);
        }
    }


Somehow I am not able to convert this HSSFChart to image. Please suggest me a way to convert to chart to image or to add them in final output.
Comment 1 Javen O'Neal 2017-09-19 04:42:20 UTC
I am not sure what the issue is. Sounds like a mixture of a usage question and a feature enhancement request. ExcelToHtmlConverter outputs to HTML, not PDF. POI currently cannot render charts to images. If anyone is interested in improving the charts API, we encourage them to contact us on the mailing list.