Link to home
Start Free TrialLog in
Avatar of Aiysha
AiyshaFlag for United States of America

asked on

Chart defaults to Bar Chart

I am using the ChartTypeData=xlLIne in my code still the plotted chart defaults to bar chart.
This is the code.

Set DataSheet = Sheets("Trial" & i).Select
With DataSheet
Set CatTitles = .Range(.Cells(2, 3), .Cells(row, 3))
Set SrcRange = .Range(.Cells(2, 2), .Cells(row, 2))
End With

Set SourceData = Union(CatTitles, SrcRange)

Sheets("Plot").Select
With ActiveChart.SeriesCollection.NewSeries
.ChartType = xlLine
.setSource DateSource:=SourceData, PlotBy:=xlRows
End With


Please help, I want to plot a range on graph as xlLine.

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
this is what i use in vb.net

With ExcelChart
            .ChartType = Excel.XlChartType.xlLine
End With

or

With ExcelChart
            .ChartType = Excel.XlChartType.xlLineMarkers
End With

~b