[Solved] How to rotate a chart?

Discuss the spreadsheet application
Post Reply
User avatar
TheAmigo
Posts: 14
Joined: Fri Mar 14, 2008 12:17 am

[Solved] How to rotate a chart?

Post 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!
Last edited by TheAmigo on Fri Mar 14, 2008 5:59 pm, edited 1 time in total.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: How to rotate a chart?

Post 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
AOO4/LO5 • Linux • Fedora 23
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: How to rotate a chart?

Post 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.)
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
User avatar
AndrewZ
Volunteer
Posts: 633
Joined: Mon Oct 08, 2007 1:25 am
Location: Colorado, USA

Re: How to rotate a chart?

Post by AndrewZ »

Have you tried putting the chart in a frame, and then rotating the frame?
* Did you solve your problem? Do others a favor: Post the solution
* Visit OpenOffice.org Ninja (blog) and OpenOffice.org Ninja Wiki for news, previews, troubleshooting, etc.
OOo 3.0.X on Fedora 9 + XP
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: How to rotate a chart?

Post 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.
AOO4/LO5 • Linux • Fedora 23
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: How to rotate a chart?

Post 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.
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
User avatar
TheAmigo
Posts: 14
Joined: Fri Mar 14, 2008 12:17 am

[Solved] Re: How to rotate a chart?

Post 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.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Solved] How to rotate a chart?

Post 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
AOO4/LO5 • Linux • Fedora 23
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

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

Post 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).
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
User avatar
TheAmigo
Posts: 14
Joined: Fri Mar 14, 2008 12:17 am

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

Post 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.
onetimeuser
Posts: 1
Joined: Thu Nov 24, 2011 2:04 am

Re: [Solved] How to rotate a chart?

Post 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
OpenOffice 3.1 on Windows Vista
Post Reply