如何更改LinearBarSeries
中条形的宽度。我尝试更改BarWidth
属性,但无效。
var series = new LinearBarSeries() {
BarWidth = 5
};
foreach (var value in values) {
series.Points.Add(new DataPoint(DateTimeAxis.ToDouble(value.DateTime), value.Value));
}
答案 0 :(得分:0)
看到类似的答案:https://stackoverflow.com/a/50453471/246758
您可能需要调整属性“ GapWidth”。从Oxyplot的BarSeries源代码中:
/// <summary>
/// Gets the actual width/height of the items of this series.
/// </summary>
/// <returns>The width or height.</returns>
/// <remarks>The actual width is also influenced by the GapWidth of the CategoryAxis used by this series.</remarks>
protected override double GetActualBarWidth()
{
var categoryAxis = this.GetCategoryAxis();
return this.BarWidth / (1 + categoryAxis.GapWidth) / categoryAxis.GetMaxWidth();
}