开发者

WPF Toolkit Chart Y-Axis Descending sort order

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

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>

And there is a databinding:

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;

But in result my Y-Axis has normal ascendin开发者_Go百科g sord order. What I do wrong? Thanks;


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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜