Page 1 of 1

[Solved] How to rotate a chart?

Posted: Fri Mar 14, 2008 12:22 am
by TheAmigo
Using OOo 2.4rc4, I created a chart, but can't figure out how to rotate it.

The only way I could get my chart rotated and into a Writer doc was to:
- copy and paste into Draw
- print to PDF (PDFCreator is broken on Vista, so I had to install OOo on a VM)
- open with Inkscape 0.46-pre3 (it's not yet released, but works)
- rotate
- save as ODG (works far better than importing SVGs into Draw)
- import back into Draw
- copy and paste into Writer

Please tell me there's an easier way that I'm missing!

Re: How to rotate a chart?

Posted: Fri Mar 14, 2008 1:59 am
by acknak
Not directly possible. The only workaround I know is similar to what you've already done:

1) Copy the chart to the clipboard
2) File > New > Drawing
3) Edit > Paste Special > GDI Metafile
You should be able to rotate the metafile, but there is a bug. You can try it and see what happens--maybe you can find a way around it.
4) Select the metafile object; Modify > Break
At this point, the object may jump to a new position, possibly off screen--a bug.
Go find the chart ;-)
5) All the text elements of the chart are mispositioned by the same amount--select them all and re-position them.
6) Select all the separate objects of the chart and group them
7) Edit > Position and Size > Rotation: whatever you want

Re: How to rotate a chart?

Posted: Fri Mar 14, 2008 2:06 am
by keme
The chart object has inherent orientation, so Open Office won't allow rotation. This limitation is hopefully temporary, but you need a workaround:

Paste special into Draw, and select the GDI metafile object type. That can be rotated freely in Draw, and you can paste it into Writer directly. You don't even need to open Draw if rotation and resizing is all you need. Paste special as GDI-... into Calc allows rotation too. That doesn't work in Writer, though. You need that one little detour of pasting in Calc or Draw. The resulting object then pasted into Writer does allow rotation. Strange...

OOo has a PDF export, BTW, so the virtual machine and PDF printer shouldn't be necessary (unless the quality suffers in the export. I haven't investigated that too closely I must admit.)

Re: How to rotate a chart?

Posted: Fri Mar 14, 2008 4:53 am
by AndrewZ
Have you tried putting the chart in a frame, and then rotating the frame?

Re: How to rotate a chart?

Posted: Fri Mar 14, 2008 6:13 am
by acknak
Paste special into Draw, and select the GDI metafile object type. That can be rotated freely in Draw, ...
Keme, have you tried this? For me, the rotation works, but there's some kind of clipping bug that causes about half of the rotated metafile to be empty. Same problem if I export to PDF. Maybe it only happens on Linux.

Re: How to rotate a chart?

Posted: Fri Mar 14, 2008 10:24 am
by keme
acknak wrote:
Paste special into Draw, and select the GDI metafile object type. That can be rotated freely in Draw, ...
Keme, have you tried this? For me, the rotation works, but there's some kind of clipping bug that causes about half of the rotated metafile to be empty. Same problem if I export to PDF. Maybe it only happens on Linux.
Yes I tested, and I didn't see any clipping when rotating 90 degrees. A corner was cut when rotating 30 degrees (I just had to try...), but no content was lost. Didn't do any extensive testing, though.

[Solved] Re: How to rotate a chart?

Posted: Fri Mar 14, 2008 5:58 pm
by TheAmigo
acknak wrote:Not directly possible. The only workaround I know is similar to what you've already done:
3) Edit > Paste Special > GDI Metafile
Good to know, I'd not heard of that before. Here's what worked for me (OOo2.3.1 Win32):
1) Copy chart
2) Paste special as GDI Metafile
3) Right-click: Position & Size -> Rotation: 90
4) Stretch to desired size.

Thanks for the tips. That's much quicker and easier, and keeps the same font.
Scaling is a bit buggy, but seems to be fine for square charts.

Re: [Solved] How to rotate a chart?

Posted: Fri Mar 14, 2008 6:50 pm
by acknak
Great! Glad it worked out.

Just for reference, I've looked into the bugs I'm bumping into here. Here's a list of issues that may be relevant:
Issue 31332: Rotating metafile containing text
Issue 36814: GDI Metafile Font location wrong
Issue 48445: wrong output of scaled and rotated metafile
Issue 76317: Text of broken metafile shifts down and to the right

View as issue list

I can't really make much sense of these--they're old, the sample files are old, or the descriptions are vague. I think I'll go ahead and file two new ones. I'll add that here at some point.

PS: Ok, I filed these two issues so there will be something specific for charts:
Issue 87039: Chart metafile: text moves on Modify > Break
Issue 87040: Chart metafile: rotated graphic is clipped

Re: [Solved] Re: How to rotate a chart?

Posted: Sat Mar 15, 2008 1:18 pm
by keme
TheAmigo wrote:
acknak wrote:Not directly possible. The only workaround I know is similar to what you've already done:
3) Edit > Paste Special > GDI Metafile
[ ... ]
Scaling is a bit buggy, but seems to be fine for square charts.
If "scaling" refers to the X/Y ratio changing, resulting in distorted shapes, there's help at hand:
Press the shift key when you're dragging to size (step 4 in your list).

Re: [Solved] Re: How to rotate a chart?

Posted: Sun Mar 16, 2008 2:47 am
by TheAmigo
keme wrote:
TheAmigo wrote: Scaling is a bit buggy, but seems to be fine for square charts.
If "scaling" refers to the X/Y ratio changing, resulting in distorted shapes, there's help at hand:
Press the shift key when you're dragging to size (step 4 in your list).
When I want to change the aspect ratio, parts of the chart get clipped. Changing the aspect ratio before starting doesn't help... it just changes which parts get clipped. I rarely do charts, so I'm not worried about it now... but it will be nice when they fix it so that charts can natively be rotated.

Re: [Solved] How to rotate a chart?

Posted: Thu Nov 24, 2011 2:11 am
by onetimeuser
Hey, if you have a graph and you want to print it horizontally on the page you can:

a) File > Page Preview > Format Page > Orientation > Landscape

b) Copy Graph > Paste to text document > Format > Page... > Orientation > Landscape

I hope this comes in handy, but if its old news, sorry XD