簡體   English   中英

WPF工具包圖表Y軸降序排列

[英]WPF Toolkit Chart Y-Axis Descending sort order

我想在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軸具有正常的上升順序。 我做錯了什么? 謝謝;

我在帶有某些IValueConverter和特殊y軸格式的官方圖表示例應用程序中找到了解決問題的方法。 謝謝 :)。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM