I'm trying to set the width of the bars in my column series, but setting ColumnWidth
on the ColumnSeries
is having no effect. How can I influence the width of the columns?
<oxy:Plot>
<oxy:Plot.Series>
<oxy:ColumnSeries ColumnWidth="1000" />
</oxy:Plot.Series>
<oxy:Plot.Axes>
<oxy:CategoryAxis Key="CategoryAxis" />
<oxy:LinearAxis />
</oxy:Plot.Axes>
</oxy:Plot>
Looking at the OxyPlot source, we can see that the actual bar width is calculated as follows. You should be able to achieve your desired effect by tweaking GapWidth
and MaxWidth
.
protected override double GetActualBarWidth()
{
var categoryAxis = this.GetCategoryAxis();
return this.ColumnWidth / (1 + categoryAxis.GapWidth) / categoryAxis.MaxWidth;
}