I have posted a question relating to MS Chart I have had hits but no responses. All I want to do is change the axes titles on a graph at run time can anyone help?
Printable View
I have posted a question relating to MS Chart I have had hits but no responses. All I want to do is change the axes titles on a graph at run time can anyone help?
I certainly do not pretend to be a chart expert! I'd answered your question in the database thread, but it is mo' better to ask and answer here.
My guess is the ChartWizard method may help, also check MSDN article Q147803. Code snippet:
Dim TheChart As Chart
Set TheChart = ActiveSheet.ChartObjects(1).Chart
' reformat Chart1 as line chart, adds legend, category and value axis titles.
TheChart.ChartWizard Gallery:=xlLine, HasLegend:=True, CategoryTitle:="X-axis", ValueTitle:="Y-Axis"
I think this might be what you are trying to do. This code will change the labels below each row in a area or bar chart. In a pie chart, the first chart will be labeled "Label 1" and the second "Label 2".
MSChart.Row = 1
MSChart.RowLabel = "Label 1"
MSChart.Row = 2
MSChart.RowLabel = "Label2"
DKCK