wpf - 如何停止在 WPF DataVisualization 图表中的 Y 轴上显示小数点

标签 wpf data-visualization wpftoolkit dotnetcharting

我正在使用 WPF DataVisualization 图表控件来显示一些示例数据。我的问题是 Y 轴显示小数值。我怎样才能让它只显示整数值。

这是我的 XAML 代码

<chartingToolkit:Chart Margin="0,30,0,30" Name="columnChart" Title="" Foreground="Black"  >
    <chartingToolkit:ColumnSeries DependentValuePath="Value" Background="Red"  
    IndependentValuePath="Key" ItemsSource="{Binding}"  >
        <chartingToolkit:ColumnSeries.DataPointStyle>
            <Style TargetType="Control">
                <Setter Property="Background" Value="#A80729"/>
            </Style>
        </chartingToolkit:ColumnSeries.DataPointStyle>
    </chartingToolkit:ColumnSeries>
</chartingToolkit:Chart>

聊天快照 here

最佳答案

设置间隔和最小值,

有些东西,比如,

    <chartingToolkit:ColumnSeries.DependentRangeAxis>
                <chartingToolkit:LinearAxis FontSize="15" Foreground="White" Interval="1" Minimum="0" Orientation="Y" ShowGridLines="False" />
            </chartingToolkit:ColumnSeries.DependentRangeAxis>
            <chartingToolkit:ColumnSeries.IndependentAxis>
                <chartingToolkit:CategoryAxis FontSize="12" Foreground="Gray" Orientation="X" ShowGridLines="False" />
            </chartingToolkit:ColumnSeries.IndependentAxis>

希望这对您有所帮助!

关于wpf - 如何停止在 WPF DataVisualization 图表中的 Y 轴上显示小数点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9342823/

相关文章:

r - 将具有第三个特征的大量点可视化为颜色 - 一种提高速度的方法

c# - 禁用 wpftoolkit 图表数据点

c# - WPF 上的嵌套网格问题

wpf - 我应该使用哪种面板来创建自定义下拉菜单?

wpf - WPF TreeView中的键盘导航

c# - 如何在 WPF DataGrid 上设置边框边距?

wpf - 同样,ObservableCollection不会更新项目

r - R plot() 或 ggplot2() 中的对数 y 轴刻度线

c# - 如何找出图像的相对路径

opengl-es - 使用 webGL 库进行数据可视化和数据分析?