简体   繁体   English

删除DevExpress图表(WinForms)上的Y轴排序

[英]Remove Y Axis Sorting on DevExpress Chart (WinForms)

I have DevExpress ChartControl and by default the Chart is sorted on Y Axis, but I don't want that behavior. 我有DevExpress ChartControl,默认情况下,图表按Y轴排序,但我不希望这种行为。 I need the ChartControl to show the datasource the way I build it. 我需要ChartControl来显示构建数据源的方式。

图表控制

The chart is sorted on Y-Axis (3010139, 3010136, 3010129, ...). 图表在Y轴上排序(3010139、3010136、3010129等)。 But, it's not the way my List was sorted, and I want to remove this behavior from my chartcontrol. 但是,这不是我的列表排序的方式,我想从我的图表控件中删除此行为。

Link to C# Code 链接到C#代码

I believe you should set either the ChartControl.SeriesSorting property value or the SeriesBase.SeriesPointsSorting property value to DevExpress.XtraCharts.SortingMode.None . 我相信您应该将ChartControl.SeriesSorting属性值或SeriesBase.SeriesPointsSorting属性值设置为DevExpress.XtraCharts.SortingMode.None

For more details please refer to Sorting Data help article. 有关更多详细信息,请参阅“ 排序数据”帮助文章。

Use the AxisBase.QualitativeScaleComparer property to define a custom axis label order (see the sample code snippet from the How to: Display Qualitative Scale Values Sorted in a Custom Sort Order article). 使用AxisBase.QualitativeScaleComparer属性定义自定义轴标签顺序(请参阅“ 如何:显示在“自定义排序顺序”文章中排序的定性刻度值”中的示例代码片段)。

The main idea is to attach a class instance implementing the System.Collections.IComparer interface to sort axis values. 主要思想是附加一个实现System.Collections.IComparer接口的类实例以对轴值进行排序。

See also: How to use the IComparable and IComparer interfaces in Visual C# article. 另请参见: 如何在Visual C#中使用IComparable和IComparer接口

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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