开发者

WPF Charting ColumnSeries with CategoryAxis, margin between the Columns

I have a column chart wh开发者_开发百科ich is grouped with a CategoryAxis.

My problem is that when the columns are grouped together there is no spacing/margin between the columns.

I have tried to apply a style with margin on the DataPoint, but the only this that does is to move all the columns but not applying a margin on each column.

See image:

WPF Charting ColumnSeries with CategoryAxis, margin between the Columns

Styling code:

<Charting:ColumnSeries.DataPointStyle>
 <Style TargetType="Charting:ColumnDataPoint">
    <Setter Property="Margin" Value="10, 0, 0, 0"/>
    <Setter
      Property="MaxWidth"
      Value="5" />
    <Setter
     Property="MaxWidth"
     Value="5" />
  </Style>
</Charting:ColumnSeries.DataPointStyle>


I was approaching this problem the wrong way, the actually issue was that all the bars are the same data series. When I split up each bar to its own data series I got the desired result.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜