[Solved] Two charts in one

Discuss the spreadsheet application
Post Reply
crowolo
Posts: 5
Joined: Sat Nov 24, 2007 6:09 pm

[Solved] Two charts in one

Post by crowolo »

hello,
say I have two x-y data:
X1: 1 3 5 || Y1: 1 9 25
X2: 2 4 6 || Y2: 4 16 36

I want to plot the two x-y lines in the same chart with oocalc, how do I do it? my problem is that I'm able to do it only with one line per chart.

thanks in advance
Last edited by crowolo on Sun Nov 25, 2007 12:36 pm, edited 1 time in total.
User avatar
Hagar Delest
Moderator
Posts: 32665
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Two charts in one

Post by Hagar Delest »

Hi crowolo,

I don't think this is directly possible because the chart must have the same X axis. So the trick would be to have 3 columns instead of 4. In the first one, put your X values : 1, 2, 3, ..., 6. In the second column, put your first set of value in front of their X value. In the third column, put your second set of values.
You should have that (I put the values in columns) :

Code: Select all

X  | Y1 | Y2
1  |  1 |
2  |    |  4
3  |  9 |  
4  |    | 16 
5  | 25 |  
6  |    | 36
Then, select your 3 columns and create your chart (type is XY (Scatter)).

Thanks to add '[Solved]' in your first post title (edit button) if your issue has been fixed.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Two charts in one

Post by acknak »

Will one of these work?

I started with A1:D4 selected, then Insert > Chart. In the Wizard, I removed the "X2" data set, and changed the "Y2" set to use C2:C4 for the X values.

The secondary Y axis is activated from the finished chart by clicking on the data set > Object Properties > Options > Align data series to secondary Y axis = YES.
Attachments
Sample 2 data set chart
Sample 2 data set chart
AOO4/LO5 • Linux • Fedora 23
User avatar
Hagar Delest
Moderator
Posts: 32665
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Two charts in one

Post by Hagar Delest »

Well done. I knew I was not an advanced user of Calc but would never have thought it could work !
Will wait before posting next time :?
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
crowolo
Posts: 5
Joined: Sat Nov 24, 2007 6:09 pm

Re: Two charts in one

Post by crowolo »

thanks, I did it.

I choosed the way hagar explained because:
- the chart with two y-axis has two different scale. I preferred to merge them.
- I didn't find this option:
acknak wrote: The secondary Y axis is activated from the finished chart by clicking on the data set > Object Properties > Options > Align data series to secondary Y axis = YES.
I don't understand where to click; I find the 'object properties' only when I'm on the chart but there isn't "options -> align data serie to secondary Y axis" there.

I forgot to say I'm using OO.o 2.2.1 on linux.
crowolo
Posts: 5
Joined: Sat Nov 24, 2007 6:09 pm

Re: [solved] Two charts in one

Post by crowolo »

I found it. object properties when you are on the line of the chart :)
Post Reply