Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default X values on a chart

Could someone give my a hand on this:
I am trying to set a range on a graph but the result does not reflect
the range values.
Here is the code:
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveChart.SeriesCollection.NewSeries
.Values = Sheets("Planif-plan").Range("H2:H79")
End With

I would like to see:
22 23 24 25 26 27 up to 52 and 1 2 3 4 up to 47
This represent 78 weeks of planning

What I get is:
1 to 78
Can this be fix?
Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default X values on a chart

Put your category values in (say) G2:H79, eg

wks = 78
wkStart = 22
For i = wkStart To wkStart + wks - 1
Range("G" & 2 + n) = (i - 1) Mod 52 + 1
n = n + 1
Next

and add to the first series in the chart
..XValues = Sheets("Planif-plan").Range("G2:G79")

Regards,
Peter T


"Bobby" wrote in message
...
Could someone give my a hand on this:
I am trying to set a range on a graph but the result does not reflect
the range values.
Here is the code:
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveChart.SeriesCollection.NewSeries
.Values = Sheets("Planif-plan").Range("H2:H79")
End With

I would like to see:
22 23 24 25 26 27 up to 52 and 1 2 3 4 up to 47
This represent 78 weeks of planning

What I get is:
1 to 78
Can this be fix?
Thank you!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default X values on a chart

Hi Bobby,

Combining your subject line with the text of your message I am assuming the
it is the X axis values that are returning sequential numbers 1-78. Is this
correct?

If my assumption is correct then you need to tell Excel the range to use for
the X Axis. Unfortunately I can't give you a full answer because I do not
know how to identify the Series Index when a new series is added as per your
code. Perhaps someone else can expand on this answer and tell us both how to
identify the series index.

The code to set the range to use for the X Axis when the series index is
known is:-

ActiveChart.SeriesCollection(1).XValues = "='Planif-plan'!R2C7:R79C7"

I have assumed that the x axis range is in column G or (7th column)

--
Regards,

OssieMac


"Bobby" wrote:

Could someone give my a hand on this:
I am trying to set a range on a graph but the result does not reflect
the range values.
Here is the code:
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveChart.SeriesCollection.NewSeries
.Values = Sheets("Planif-plan").Range("H2:H79")
End With

I would like to see:
22 23 24 25 26 27 up to 52 and 1 2 3 4 up to 47
This represent 78 weeks of planning

What I get is:
1 to 78
Can this be fix?
Thank you!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default X values on a chart

If the numbers are in the order you want, then make a line chart rather than
an XY chart. The line chart treats everything, even numbers, as nonnumeric
labels.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Bobby" wrote in message
...
Could someone give my a hand on this:
I am trying to set a range on a graph but the result does not reflect
the range values.
Here is the code:
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveChart.SeriesCollection.NewSeries
.Values = Sheets("Planif-plan").Range("H2:H79")
End With

I would like to see:
22 23 24 25 26 27 up to 52 and 1 2 3 4 up to 47
This represent 78 weeks of planning

What I get is:
1 to 78
Can this be fix?
Thank you!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default X values on a chart

On Mar 31, 10:20*pm, "Jon Peltier"
wrote:
If the numbers are in the order you want, then make a line chart rather than
an XY chart. The line chart treats everything, even numbers, as nonnumeric
labels.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.http://PeltierTech.com/WordPress/
_______

"Bobby" wrote in message

...



Could someone give my a hand on this:
I am trying to set a range on a graph but the result does not reflect
the range values.
Here is the code:
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveChart.SeriesCollection.NewSeries
*.Values = Sheets("Planif-plan").Range("H2:H79")
End With


I would like to see:
22 23 24 25 26 27 up to 52 and 1 2 3 4 up to 47
This represent 78 weeks of planning


What I get is:
1 to 78
Can this be fix?
Thank you!- Hide quoted text -


- Show quoted text -


Thank's Jon
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
In Office 2007 can't see chart series values unless chart unprotec Carl Charts and Charting in Excel 0 October 28th 09 03:31 AM
Only chart numerical values, not error values andy Charts and Charting in Excel 2 November 8th 07 10:46 PM
chart from pivot data does not update x-axis bar chart values - bug jason gers Excel Discussion (Misc queries) 0 April 3rd 07 06:34 PM
Huge differences in chart values screws my bar chart scale up. Sirritys Charts and Charting in Excel 2 June 13th 06 10:33 AM
Can I obtain x values from y values on an Excel chart? Helen Charts and Charting in Excel 1 March 7th 06 03:05 PM


All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"