【问题标题】:WPF Toolkit Chart Y-Axis Descending sort orderWPF 工具包图表 Y 轴降序排序
【发布时间】:2011-01-04 14:31:13
【问题描述】:

我想在我的 WPF 图表对象中反转 Y 轴。 http://i.stack.imgur.com/M0oaA.jpg

为此,我尝试使用此 xaml 代码:

<my:Chart Name="chart1">
            <my:Chart.Axes>
                <my:CategoryAxis Orientation="Y" ShowGridLines="True" SortOrder="Descending" />
                <my:CategoryAxis Orientation="X" />
            </my:Chart.Axes>
            <my:Chart.Series>
                <my:LineSeries x:Name="ser"
                               IndependentValueBinding="{Binding Value}"
                               DependentValueBinding="{Binding Key}" AnimationSequence="FirstToLast" />
            </my:Chart.Series>
        </my:Chart>

还有一个数据绑定:

Dictionary<int, int> source2 = new Dictionary<int, int>();
            source2.Add(13, 1);
            source2.Add(23, 2);
            source2.Add(33, 3);
            source2.Add(10, 4);

            ser.ItemsSource = source2;

但结果我的 Y 轴具有正常的升序排列。我做错了什么?谢谢;

【问题讨论】:

    标签: wpf charts toolkit


    【解决方案1】:

    我在带有一些 IValueConverter 和特殊 y 轴格式的官方图表示例应用程序中找到了我的问题的解决方案。谢谢:)。

    http://dlaa.me/blog/post/9607895

    【讨论】:

    • 您的回答有点含糊...您介意发布一些代码吗?
    • 官方示例包含此代码。我失去了这个档案的超链接:(
    • 添加了答案的缺失链接。
    猜你喜欢
    • 1970-01-01
    • 2021-04-28
    • 1970-01-01
    • 1970-01-01
    • 2013-03-16
    • 1970-01-01
    • 1970-01-01
    • 2023-03-26
    相关资源
    最近更新 更多