简体   繁体   中英

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. I need the ChartControl to show the datasource the way I build it.

图表控制

The chart is sorted on Y-Axis (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

I believe you should set either the ChartControl.SeriesSorting property value or the SeriesBase.SeriesPointsSorting property value to 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).

The main idea is to attach a class instance implementing the System.Collections.IComparer interface to sort axis values.

See also: How to use the IComparable and IComparer interfaces in Visual C# article.

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