Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel chart point color

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
Hi all,

I need to show just two columns in my Excel Chart, representing each pair as a point on the chart. (First column as X co-ordinate, and second column as Y co-ordinate.) But some of the points need to be of one color, and others of another color.

Is this possible? Could someone guide me please? Or else is there any other software that I can use?

Thanks a lot,
Sheila
 
Hi Sheila,

Can you post an example of the data you wish to chart, and what criteria you expect to make exceptions on?

Paul

PS in terms of other software - SPSS, SPSS-X expensive but good, you gotta look 4 bang 4 buck in terms of deployment b4 looking at other software

Again Paul
 
Paul,

I simply want to plot points in 2D plane with X & Y axis. What's called "Scatter" type chart in the Excel. Just that Excel chart shows all the points of the same color. I need to show them in different groups, each group in a separate color.

An example is: The Office XP Chart Component allows you to conditionally format data series on a chart.
But I don't have that component.

Hope I am cear.
Sheila
 
You can select each individual Point to change the color you want to

Hope this helps.

Ram P
 
Sheila,

when you're putting together your data points, try it like this

X-axis Range 1 Range 2
1 2.5 6
2 3 7.3
3 -2 8
4 -0.5 2

Select all 3 columns, and the chrt wizard will select the third column as series 2, and it will automatically format these points in a different colour, and plot them against the same x-axis

Hope this helps

;P
 
You can either use Paul's approach (or, more likely, a variation thereof where you have

X1 Y1 X2 Y2 X3 Y3
.. .. .. .. .. ..
.. .. .. .. .. ..

with each pair of X and Y having a different color. If it's difficult to separate out the series in that way, you can still run through the points of a single series and set their colors one by one. Say you have an additional column (starting in C1) with color codes:

Dim pt As Point, cell as range, ci as integer
set cell=range("C1")
For Each pt In ActiveChart.SeriesCollection(1).points
select case cell
case "yellow":ci=vbYellow
case "red":ci=vbRed
case "blue":ci=vbBlue
end select
pt.MarkerBackgroundColor = ci
pt.MarkerForegroundColor = ci
set cell=cell.offset(1,0)
Next pt
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top