Search: | |||||

| ||||

Home » Forum » MS Office | RSS Feeds |

I am generating multiple graphs. I have problems with series name. ( I am

generating only 1 series in each graph).

When the second graph is generated, the series name of the first graph changes

to the second graph's series name. When the third graph is generated, the series

name of both first & second graph changes to the third graph's series name and

so on.

Can anyone help me fix it?

Here's Code:

For rowNum = 2 To dataSheet.UsedRange.Count

If dataSheet.Cells(rowNum, 4) <> currentTestCell Or _

dataSheet.Cells(rowNum, 1) <> currentPNCell Then

endRow = rowNum - 1

'ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R9C3:R15C3"

'ActiveChart.SeriesCollection(1).Values = "=Sheet1!R9C7:R15C7"

xrangeStr = "=" & dataSheet.Name & "!R" & startRow & "C3:R" & endRow &

"C3"

valrangeStr = "=" & dataSheet.Name & "!R" & startRow & "C7:R" & endRow &

"C7"

Application.CutCopyMode = False

Charts.Add

ActiveChart.ChartType = xlLineMarkers

ActiveChart.SeriesCollection.NewSeries

ActiveChart.SeriesCollection(1).XValues = xrangeStr

ActiveChart.SeriesCollection(1).Values = valrangeStr

ActiveChart.SeriesCollection(1).Name = currentPNCell

ActiveChart.Location Where:=xlLocationAsObject, Name:=dataSheet.Name

With ActiveChart

.HasTitle = True

.ChartTitle.Characters.Text = currentTestCell

.Axes(xlCategory, xlPrimary).HasTitle = True

.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Period"

.Axes(xlValue, xlPrimary).HasTitle = True

.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Boards/hour"

End With

currentPNCell = dataSheet.Cells(rowNum, 1)

currentTestCell = dataSheet.Cells(rowNum, 4)

startRow = rowNum

Your code seems to generate a number of "graphs" in one place. i.e. they are

all piled on top of each other. They are strange graphs as they have only one

point plotted (plus a value of 1 for series 2). All the graphs seem to be

different.

It might help if you could tell us what your data looks like and what you are

trying to do. Also could you post the code for the whole sub so we can

understand it.

The series name for Series 1 in each graph seems to be the value of column A

in the relevant row. The Graph Title is Column D for the row.

I cannot reproduce your problem but it may relate to other parts of the code

which you have not yet told us.

Didn't find what you were looking for?
Find more on Naming series in multiple Graphs
Or get search suggestion and latest updates.

Related Topics:

- Display multiple series of data
- Multiple record formats with same field names
- Linking multiple values to one name
- Best way to load multiple images across multiple classes in an appl
- Add-Ins loaded into Excel
- fill series and select a range
- Chart Series
- sum of series of natural numbers
- How is inserting fibonacci series in singly linked list done?
- C: Find the longest series of even and positive numbers
- display series
- programming to display series of 24,99,224,399....upto 10 numbers
- Alphanumeric Series auto filling
- graph visit
- Graph program does not work with data from Access via MS Query
- Graph equation
- dynamic graph title
- Graphs Help Needed
- Java-based NoSQL Graph Database
- plotting graph in applet
- Graph,Edge,Node classes
- Help on CEWolf graphs
- printing document in multiple pages
- why java wont support multiple inheritance
- example of java in multiple looping