[
https://issues.apache.org/jira/browse/ODFTOOLKIT-390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14017529#comment-14017529
]
Juan Pablo Barani commented on ODFTOOLKIT-390:
----------------------------------------------
Original code to reproduce the issue:
TextDocument l_originalTextDocument = (TextDocument)
TextDocument.loadDocument("D:\\Temp\\originalDoc.odt");
List<Chart> l_allCharts =
l_originalTextDocument.getChartByTitle("myChart");
Chart l_firstChart =
l_originalTextDocument.getChartByTitle("myChart").get(0);
System.out.println("Printing details about the chart...");
System.out.println("Chart type: " +
l_firstChart.getChartType());
DataSet chartData = l_firstChart.getChartData();
l_firstChart.setChartData(chartData);
l_originalTextDocument.save("D:\\Temp\\changedDoc.odt");
> setChartData always resets the chart type to column chart / Chart type always
> returns the same value
> ----------------------------------------------------------------------------------------------------
>
> Key: ODFTOOLKIT-390
> URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-390
> Project: ODF Toolkit
> Issue Type: Bug
> Components: odfdom, simple api
> Affects Versions: 0.6.1-incubating
> Environment: Windows 8 - Java 1.7 - Eclipse Kepler
> Reporter: Juan Pablo Barani
>
> Hi! I found several things that may be related to the same issue. I am
> developing an application that simply gets a template chart, and replaces the
> datasets.
> However, in the process the chart type gets changed automatically without
> reason. These are the sub-issues I found:
> 1) When getting the chart type of a chart in a text document, the value
> returned is always the same, no matter if we have a pieChart or something
> different:
> textDocument.getChartByTitle("myChart").get(0).getChartType();
> Value: "chart:bar"
> Also tried with getChartById, bit no luck, it always returns the same value.
> 2) If I set a new dataset (even the same one as before) by the following code:
> Chart l_firstChart = l_originalTextDocument.getChartByTitle("myChart").get(0);
> l_firstChart.setChartData(l_firstChart.getChartData());
> The chart is automatically converted back to a column chart, no matter what
> the original chart type was.
> 3) I could set again the chart type manually. However, if we have a chart
> with horizontal bars, there is no way to get it right;
> l_firstChart.setChartType(ChartType.BAR);
> will redraw the chart with vertical bars (columns), and there is no such
> setting as ChartType.COLUMN or something similar.
> Unfortunately this is preventing us from using the library to manipulate the
> charts. I tried updated to the latest simpleodf version, but no luck :-(
--
This message was sent by Atlassian JIRA
(v6.2#6252)