Line chart formatting

R

r10jdl

Hi. I have a chart with 96 series, these series have around 76 data points
each and are expressed in a line chart. I would like to be able to
automatically colour the lines for each series based upon the name of each
series. The names of each series are identified by the header of the
particular column/row.

Is this possible?

I have looked through other questions on here, but they dont seem to be
relevant to this particular case.

Thanks in advance.

James
 
B

Bob Phillips

Seeing as Excel pre-2007 only has a 56 colour colour palette, how do you
distinguish between them?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

r10jdl

Most would be in the same group, so the same colour. i.e. 10 of one 10 of
another etc. Anything not classed in a particular group would be classed in
an unknown group, which would all be the same colour.

Any sense to that?
 
B

Bob Phillips

Yeah, but I think you have to do it by VBA.

Here is a basic example that you can tweak

Dim i As Long
Dim arycolours

arycolours = Array(36, 38, 53, 3, 5, 6, 10, 41, 56, 387, 22)

With ActiveSheet.ChartObjects(1).Chart

For i = 1 To 9

.SeriesCollection(i).Border.ColorIndex = arycolours(i - 1)
Next i
End With


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

r10jdl

Thanks Bob.

I have no experience with VBA, so wouldn't know where to start.

Cheers,

Jim
 
B

Bob Phillips

Okay. Let's get a bit more detail.

You say you have 96 series, coloured in groups of 10. Are they structures,
such that series 1-10 is one colour, 11-20 another and so on. What are the
colours (preferably colorindex) per group?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
R

r10jdl

Hi again.

As an example there would be 10 of one condition (call them positive -
Green) 10 of another (Negative - Red) and the 76 remaining would be unknowns
which would be grouped in the same colour(Blue).

Would it help to send the spreadsheet?

Many thanks for your help,

James
 
B

Bob Phillips

Yeah that would be best.

But also explain, what does unknown mean, they must be positive or
negative.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top