My First XY Chart

Discuss the spreadsheet application
Post Reply
eschamp
Posts: 8
Joined: Sun Mar 28, 2010 6:56 pm

My First XY Chart

Post by eschamp »

I have a spreadsheet with the following columns and data ranges:

A: date
B: odometer reading -- 100000 max
C: trip odometer
D: gas purchased
E: cost
F: cost/gal -- $5.00 max
G: MPG -- 20-40

I want an X-Y scatter plot of B, F and G vs A. I would like separate scales for each Y-axis value.

How do I get date as the X-axis and how do I get multiple Y-axis scales?

Thanks.

OOo 3.2 on Windows 7
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: My First XY Chart

Post by acknak »

Select a range of cells containing the data, then click the "Create Chart" button on the toolbar, then configure your chart with the steps that follow. The "Chart" button may a little hard to find by looking at the picture on it--it's a pie chart, but the version I have is too small to tell what it is. It's just to the right of the "Sort" buttons ("A..Z" and "Z..A").

You can have only two independent Y axes. If you need more than that, you'll have to use separate charts.
AOO4/LO5 • Linux • Fedora 23
eschamp
Posts: 8
Joined: Sun Mar 28, 2010 6:56 pm

Re: My First XY Chart

Post by eschamp »

"configure your chart with the steps that follow" doesn't quite do it for me. For example, I selected a rectangular range of data that included all columns and rows 200-250.

I selected XY chart and then removed the columns I didn't want. Then I produced the chart. The X-axis was NOT column A. The scale of the Y-axis was in dollars but 10s of thousands.

I'm a bit baffled. As I said, "How do I get date (A) as the X-axis and how do I get multiple Y-axis scales?"
OOo 3.2
Windows 72
eschamp
Posts: 8
Joined: Sun Mar 28, 2010 6:56 pm

Re: My First XY Chart

Post by eschamp »

How do I change the legend so that it has text instead of Col G, etc.?
OOo 3.2
Windows 72
User avatar
Cambirder
Volunteer
Posts: 647
Joined: Thu Nov 22, 2007 1:01 am

Re: My First XY Chart

Post by Cambirder »

It might help if you could upload what you have done so far.
OOo 3.3 on Windows 7 & 3.2.1 on Mint 10
eschamp
Posts: 8
Joined: Sun Mar 28, 2010 6:56 pm

Re: My First XY Chart

Post by eschamp »

Cambirder wrote:It might help if you could upload what you have done so far.
You want a screenshot of the chart?
OOo 3.2
Windows 72
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: My First XY Chart

Post by acknak »

"configure your chart with the steps that follow" doesn't quite do it for me.
Ok; fair enough.

1) Open the attached file
2) With A1 as the current cell, click on the "Chart" button in the toolbar. With no cells selected, Calc will try to find the extent of the data automatically, which is fine in this case.
3) Configure your chart with the steps that follow...
  • Chart Wizard Step 1: Chart type: XY (Scatter). Click "Next"
    Chart Wizard Step 2: Data Range (defaults are ok here). Click "Next"
    Chart Wizard Step 3: Data Series: Select the data sets (columns) that you don't want and click the "Remove" button. At the end, you should have only "Odometer" and "Efficiency" left. The first column (date) will be used for the x values.
    Click "Next"
    Chart Wizard Step 3: Chart elements (defaults are ok here). Click "Finish"
4) To get the efficiency data on a separate axis, right-click on the data line in the chart and choose "Format Data Series"
5) Options > Align data series to: Secondary axis

You can watch that here: http://www.youtube.com/watch?v=uWvu8293Y6E (YouTube is giving me an error at the moment, but eventually it should be available).

For general instructions on creating charts in Calc, see the Calc Guide: http://wiki.services.openoffice.org/wik ... Calc_Guide, especially Chapter 3 Creating Charts and Graphs: http://wiki.services.openoffice.org/wik ... and_Graphs
 Edit: PS: 
Oops--forgot the file...
Attachments
xy_chart_mileage.ods
(19.39 KiB) Downloaded 314 times
AOO4/LO5 • Linux • Fedora 23
eschamp
Posts: 8
Joined: Sun Mar 28, 2010 6:56 pm

Re: My First XY Chart

Post by eschamp »

Wow! But I couldn't find the attached file.

I'll try this with my file and let you know what happens.
OOo 3.2
Windows 72
eschamp
Posts: 8
Joined: Sun Mar 28, 2010 6:56 pm

Re: My First XY Chart

Post by eschamp »

Terrific! The secondary axis is rescaled to fit the data and does not start at zero!!

The first date in the table is 3/16/04 but the origin of the X-axis is 1/14/04. IS there any way to make the X-axis begin at my first data point?

Thanks.
OOo 3.2
Windows 72
arnk
Posts: 2
Joined: Wed Mar 31, 2010 11:24 pm

Re: My First XY Chart

Post by arnk »

Click on chart to highlight it
Right click and select edit
Mouse over your x Axis until the pop-up says X Axis
Left Click to select X Axis
Right Click and select Format Axis
Select Scale Tab
Untick the Automatic check box for both maximum and minimum
Enter new values as you wish
You can zoom into a section of a chart doing this - no need to adjust the data ranges.
Al
Open Office 3.2 on Windows Vista
eschamp
Posts: 8
Joined: Sun Mar 28, 2010 6:56 pm

Re: My First XY Chart

Post by eschamp »

Thanks, Al.

I started my graph at A6 so the legend does not have the correct words. How do I edit the legends?
OOo 3.2
Windows 72
eschamp
Posts: 8
Joined: Sun Mar 28, 2010 6:56 pm

Re: My First XY Chart

Post by eschamp »

acknak wrote: You can watch that here: http://www.youtube.com/watch?v=uWvu8293Y6E
Is that a silent movie?
OOo 3.2
Windows 72
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: My First XY Chart

Post by acknak »

As far as I know, you cannot edit the legend text directly. The text shown in the legend comes from the cell range labeled "Name" in the chart data series dialog window. That cell range usually corresponds to the top row of the data table, but it can be anywhere.
Is that a silent movie?
Right: there is no audio.
AOO4/LO5 • Linux • Fedora 23
Post Reply