'VBA: getting rid of GapWidth in Combo Chart (Lines + Clustered Columns) does not work
I am using VBA for ppt deck populating (using template) and I am not able to get rid of Gap Width for one data series in Combo Chart. Chart includes lines for avg prices (primary axis), clustered columns for units (secondary axis) and clustered column for Period (primary axis), where I am trying to use GapWidth = 0 that should serve just for highlighting the period. Please note I am talking about visualisation, not data missing problem or data==0 problem. This is how data looks like (dummy data):
| Date | Period | Avg Price | Units |
|---|---|---|---|
| 04/05/2019 | 0 | 10 | 21 |
| 05/05/2019 | 0 | 9.5 | 26 |
| 06/05/2019 | 1000 | 7.0 | 43 |
| 07/05/2019 | 1000 | 7.0 | 47 |
I am using below lines, but it is completely ignored. Could someone please help? Thank you!
newPpt.Slides("ItemsPrice").Shapes("Items_price_chart").Chart.FullSeriesCollection(1).ChartType = xlColumnClustered
newPpt.Slides("ItemsPrice").Shapes("Items_price_chart").Chart.FullSeriesCollection(1).AxisGroup = 1
newPpt.Slides("ItemsPrice").Shapes("Items_price_chart").Chart.FullSeriesCollection(1).Select
newPpt.Slides("ItemsPrice").Shapes("Items_price_chart").Chart.ChartGroups(1).GapWidth = 0
With Selection.Format.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorBackground2
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0
.Solid
End With
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
