Hi,
I used the following code trying to create a chart but the lines showing in the chart are sort of accumulation of the data source, which is not what I expected. They should be individually showing themselves instead of summing up.
Is there any way to get what I expected?
Thanks in advance.
Sub CreateChart()
'On Error Resume Next
Range("A3:N21").Select
Charts.Add
ActiveChart.ChartType = xlLineMarkersStacked
ActiveChart.SetSourceData Source:=Sheets("GraphDisplayMKT").Range("C24:N30"), _
PlotBy:=xlRows
ActiveChart.Location Where:=xlLocationAsObject, Name:="GraphDisplayMKT"
With ActiveChart
.HasTitle = True
.HasLegend = False
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "BRA Share"
.ChartTitle.Characters.Text = "BRA Product"
.HeightPercent = 60
End With
With ActiveSheet.Shapes("Chart 1")
.ScaleHeight 1.39, msoFalse, msoScaleFromBottomRight
.ScaleWidth 1.5, msoFalse, msoScaleFromBottomRight
.ScaleHeight 0.77, msoFalse, msoScaleFromTopLeft
.ScaleWidth 1.22, msoFalse, msoScaleFromTopLeft
End With
ActiveChart.ChartArea.Select
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 7
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveChart.Legend.Delete = True
On Error GoTo 0
End Sub
I used the following code trying to create a chart but the lines showing in the chart are sort of accumulation of the data source, which is not what I expected. They should be individually showing themselves instead of summing up.
Is there any way to get what I expected?
Thanks in advance.
Sub CreateChart()
'On Error Resume Next
Range("A3:N21").Select
Charts.Add
ActiveChart.ChartType = xlLineMarkersStacked
ActiveChart.SetSourceData Source:=Sheets("GraphDisplayMKT").Range("C24:N30"), _
PlotBy:=xlRows
ActiveChart.Location Where:=xlLocationAsObject, Name:="GraphDisplayMKT"
With ActiveChart
.HasTitle = True
.HasLegend = False
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "BRA Share"
.ChartTitle.Characters.Text = "BRA Product"
.HeightPercent = 60
End With
With ActiveSheet.Shapes("Chart 1")
.ScaleHeight 1.39, msoFalse, msoScaleFromBottomRight
.ScaleWidth 1.5, msoFalse, msoScaleFromBottomRight
.ScaleHeight 0.77, msoFalse, msoScaleFromTopLeft
.ScaleWidth 1.22, msoFalse, msoScaleFromTopLeft
End With
ActiveChart.ChartArea.Select
With Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 7
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveChart.Legend.Delete = True
On Error GoTo 0
End Sub