By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 834 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

MSGraph.Chart 8.0 Modification

P: n/a
Can someone tell me how to change a single legend entry from a Stacked
Bar Chart to a Line Chart. All the rest need to stay at a Stacked Bar
Chart. Line 50 on the below code is what needs to be changed.

Thanks

*****************************************
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
1 On Error GoTo Err_dF
5 Dim chr As Graph.Chart
10 Dim j As Integer
15 Dim X As String
20 Set chr = myChart.Object
25 With chr.Legend
30 j = .LegendEntries.Count
35 For i = 1 To j
40 X = .Application.DataSheet.Cells(i + 1, 1)
45 Select Case X
Case "Actual"
50 .LegendEntries(i).LegendKey.Interior.Color = 0
Case "PM/Engr."
55 .LegendEntries(i).LegendKey.Interior.Color =
32768
Case "Equip"
60 .LegendEntries(i).LegendKey.Interior.Color =
65535
Case "Matl"
65 .LegendEntries(i).LegendKey.Interior.Color =
16711680
Case "Merit"
70 .LegendEntries(i).LegendKey.Interior.Color =
39423
Case "JEG_SC"
75 .LegendEntries(i).LegendKey.Interior.Color =
255
Case "BPMISC"
80 .LegendEntries(i).LegendKey.Interior.Color =
16763904
Case "BP_SC"
85 .LegendEntries(i).LegendKey.Interior.Color =
13209
Case "Conting"
90 .LegendEntries(i).LegendKey.Interior.Color =
16751052
Case "UN"
95 .LegendEntries(i).LegendKey.Interior.Color =
RGB(255, 255, 255)
100 End Select
105 Next
110 End With
Exit_dF:
115 Exit Sub
Err_dF:
120 If Err.Number = 1004 Then
125 Resume Next
130 Else
135 MsgBox Err.Number & " " & Err.Description & chr(13) &
chr(10) & "Detail Format Line No: " & Erl
140 Resume Exit_dF
145 End If
End Sub
Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.