Setting the colour of the legends in chart.

S

Senthil

Hi Friends
I create a Line - Column on 2 Axes chart in Excel and I want to
change the colour of the Legends.
Can anyone help me with that???
Here is the code for the Chart creation.....

Regards
Senthil

Sub ExcelChart()

ActiveWorkbook.Charts.Add
ActiveChart.SetSourceData
Source:=Sheets("Sheet1").Range("A1:J13"), PlotBy:= _
xlRows
ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:= _
"Line - Column on 2 Axes"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"

With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "AME Gear"
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Count"
.Axes(xlCategory, xlSecondary).HasTitle = False
.Axes(xlValue, xlSecondary).HasTitle = True
.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text =
"Percent"
End With

With ActiveChart.Parent
.Top = 170
.Left = 10
.Height = 350
.Width = 600
End With

ActiveChart.HasLegend = True

End Sub
 

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