Bug 271778 - Bar chart is dispalying as Column chart
Summary: Bar chart is dispalying as Column chart
Status: VERIFIED FIXED
Alias: None
Product: calligrachart
Classification: Applications
Component: opendocument (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: T Zachmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-26 16:23 UTC by swathi
Modified: 2011-12-01 08:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test data (16.70 KB, application/vnd.oasis.opendocument.presentation)
2011-04-26 16:23 UTC, swathi
Details
Screenshot in Open Office (167.26 KB, image/x-png)
2011-04-26 16:25 UTC, swathi
Details
Screenshot in Calligra Stage (159.70 KB, image/x-png)
2011-04-26 16:25 UTC, swathi
Details
Test data (50.95 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2011-05-10 08:17 UTC, swathi
Details
Screenshot in MS Office (144.83 KB, image/x-png)
2011-05-10 08:19 UTC, swathi
Details
Screenshot in Calligra Stage (162.32 KB, image/x-png)
2011-05-10 08:20 UTC, swathi
Details
Test data in ODT format (12.80 KB, application/vnd.oasis.opendocument.text)
2011-05-11 14:16 UTC, swathi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description swathi 2011-04-26 16:23:47 UTC
Created attachment 59331 [details]
Test data

Version: git text-layoutrestructure-boemann branch
         (Using KDE 4.5.5)                
     OS: Kubuntu 10.10
Test data is in ODP format which has percentage stacked bar chart in it.
Open the same document in Calligra Stage and check the direction of the chart.

Expected outcome:
Chart should be displayed in horizontal direction.

Actual outcome:
Chart is displaying in vertical direction.
Please check the screenshots attached.

Frequency:
Always.
Comment 1 swathi 2011-04-26 16:25:02 UTC
Created attachment 59332 [details]
Screenshot in Open Office
Comment 2 swathi 2011-04-26 16:25:31 UTC
Created attachment 59333 [details]
Screenshot in Calligra Stage
Comment 3 swathi 2011-04-26 16:28:32 UTC
Values along along the Y axis are also wrong.
Comment 4 swathi 2011-05-10 08:17:47 UTC
Created attachment 59834 [details]
Test data

Even for pptx files also,Bar chart is dispalying as column chart.
Attaching the test data.
Comment 5 swathi 2011-05-10 08:19:53 UTC
Created attachment 59835 [details]
Screenshot in MS Office
Comment 6 swathi 2011-05-10 08:20:50 UTC
Created attachment 59836 [details]
Screenshot in Calligra Stage
Comment 7 swathi 2011-05-11 14:16:36 UTC
Created attachment 59903 [details]
Test data in ODT format

Similar issue is observed for the .odt format also.Attaching the test data.
Comment 8 Sebastian Sauer 2011-08-30 13:15:45 UTC
Fixed with 97a7e2dde139c450bb69fa5879effd54adf74c07
Comment 9 Sebastian Sauer 2011-08-30 19:21:31 UTC
Reopen cause commit 97a7e2dde139c450bb69fa5879effd54adf74c07 didn't fully fixed the issue. Investigating alternates atm.

Current state;

diff --git a/plugins/chartshape/Axis.cpp b/plugins/chartshape/Axis.cpp
index 5fff771..fcb7493 100644
--- a/plugins/chartshape/Axis.cpp
+++ b/plugins/chartshape/Axis.cpp
@@ -462,9 +462,14 @@ void Axis::Private::createBarDiagram()
 
     kdBarDiagram = new KDChart::BarDiagram( plotArea->kdChart(), kdPlane );
     registerDiagram( kdBarDiagram );
+
     // By 'vertical', KDChart means the orientation of a chart's bars,
     // not the orientation of the x axis.
-    kdBarDiagram->setOrientation( plotArea->isVertical() ? Qt::Horizontal : Qt::Vertical );
+
+//kdBarDiagram->setOrientation( plotArea->isVertical() ? Qt::Horizontal : Qt::Vertical );
+//kdBarDiagram->setOrientation( plotArea->isVertical() ? Qt::Vertical : Qt::Horizontal );
+kdBarDiagram->setOrientation( q->orientation() );
+
     kdBarDiagram->setPen( QPen( Qt::black, 0.0 ) );
 
     if ( plotAreaChartSubType == StackedChartSubtype )
diff --git a/plugins/chartshape/PlotArea.cpp b/plugins/chartshape/PlotArea.cpp
index 63e425b..28ae2eb 100644
--- a/plugins/chartshape/PlotArea.cpp
+++ b/plugins/chartshape/PlotArea.cpp
@@ -655,8 +655,10 @@ bool PlotArea::loadOdf( const KoXmlElement &plotAreaElement,
     // These things include chart subtype, special things for some
     // chart types like line charts, stock charts, etc.
     if ( plotAreaElement.hasAttributeNS( KoXmlNS::chart, "style-name" ) ) {
+        // the clear and fill is needed here as someone changes the style stack since the last time we used it
+        // Maybe we can move the stuff up to be at the same place to work correctly?
         styleStack.clear();
-        //context.odfLoadingContext().fillStyleStack( plotAreaElement, KoXmlNS::chart, "style-name", "chart" );
+        context.odfLoadingContext().fillStyleStack( plotAreaElement, KoXmlNS::chart, "style-name", "chart" );
 
         styleStack.setTypeProperties( "graphic" );
         styleStack.setTypeProperties( "chart" );

The change in Axis.cpp should be more or less logical correct. We probably need to take the orientation of the proxymodel into account too or could there be other reasons this doesn't work as expected?

The change in PlotArea.cpp seems to have all kind of side-effects. Question here is why fillStyleStack is done if we don't save+restore?
Comment 10 Sebastian Sauer 2011-11-02 15:01:00 UTC
Was fixed meanwhile.
Comment 11 swathi 2011-12-01 08:16:34 UTC
Verified in 5992551fa6b6bf4e2d716728e086fd48ff905e33 .
But still the Axies are displaying in reverse direction,It will be raised as a seperate bug.