WPF工具包图表Y轴降序排列 [英] WPF Toolkit Chart Y-Axis Descending sort order

查看:79
本文介绍了WPF工具包图表Y轴降序排列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I want to reverse Y-Axis in my WPF Chart object. http://i.stack.imgur.com/M0oaA.jpg

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

For this I trying use this xaml code:

<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轴具有正常的上升顺序.我做错了什么?谢谢;

But in result my Y-Axis has normal ascending sord order. What I do wrong? Thanks;

推荐答案

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

I found solution for my problem in official chart sample application with some IValueConverter and special y-Axis format. Thanks :).

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

这篇关于WPF工具包图表Y轴降序排列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆