简体   繁体   中英

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 ascending 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM