Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi ,
I have a line chart , i have added macro for adding expression dynamically. i want the line with circles and size should be 4
regards,
sam
hi,
Below is the cdoe for creating and new chart and also for adding a new expression
' -------------------------------------- Adding NEw Chart ---------------------------------------------
set chart = ActiveDocument.ActiveSheet.CreateComboChart
chart.AddDimension "ProductType"
chart.AddExpression "sum(Amount)"
set p = chart.GetProperties
set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual
expr.ShowAsBar = false
expr.ShowAsLine = true
expr.ShowAsSymbol = true
expr.SymbolMode =3 '0=Auto, 1=Circles, 2=Dots, 3=Squares...
chart.SetProperties p
p.ChartProperties.LineWidth = 12
chart.SetProperties p
p.ChartProperties.SymbolSize = 16
chart.SetProperties p
' ---------------------------------- Adding New Expression-------------------------------------------------
set chart = ActiveDocument.GetSheetObject("CH01")
chart.AddExpression "sum(Amount)"
set p = chart.GetProperties
p.ChartProperties.LineWidth = 12
p.ChartProperties.SymbolSize = 16
chart.SetProperties p
set expr = p.Expressions.Item(0).Item(0).Data.ExpressionVisual
expr.ShowAsBar = false
expr.ShowAsLine = true
expr.ShowAsSymbol = true
expr.LineMode = 1 '0=Normal, 1=Smooth, 2=Plateau leading...
expr.SymbolMode = 1 '0=Auto, 1=Circles, 2=Dots, 3=Squares...
chart.SetProperties p
Hi Deepak,
Thanks for the quick reply and thks for the code, it work for me.