【问题标题】:OxyPlot: Change LinearBarSeries bar wdthOxyPlot:更改 LinearBarSeries 条形宽度
【发布时间】:2018-12-11 16:51:33
【问题描述】:

如何更改LinearBarSeries 中条形的宽度。我尝试更改 BarWidth 属性但没有效果。

var series = new LinearBarSeries() {
    BarWidth = 5
};
foreach (var value in values) {
    series.Points.Add(new DataPoint(DateTimeAxis.ToDouble(value.DateTime), value.Value));
}

【问题讨论】:

    标签: c# width oxyplot


    【解决方案1】:

    查看类似答案: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();
        }
    

    【讨论】:

      猜你喜欢
      • 2013-03-22
      • 1970-01-01
      • 2018-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-25
      相关资源
      最近更新 更多