BootstrapChartDataPrepareSettings.SortingMethod Property
Specifies the sorting order in which series points should be drawn.
Namespace: DevExpress.Web.Bootstrap
Assembly: DevExpress.Web.Bootstrap.v24.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
Object | true | A Boolean value or a comparison function that indicates whether a should go before b. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to SortingMethod |
---|---|
BootstrapCoordinateSystemChart |
|
BootstrapRangeSelectorChart |
|
Remarks
The property works in different ways depending on the property value’s type. The following types are allowed:
Boolean
When this option is set to true, the series points are drawn in order of increasing argument. Otherwise, the order of drawing the series points is the same as the order of objects in the data source.
Note
We recommend setting this option to false if objects in the data source are already sorted properly. This will improve widget performance.
When the BootstrapChartArgumentAxis.ArgumentType is ‘string‘, the SortingMethod property does not accept Boolean values. However, you can still apply sorting using a comparison function. Alternatively, use the BootstrapChartArgumentAxis.Categories array to perform the same task. Note that the Categories array takes precedence over the SortingMethod function.
A comparison function
A comparison function accepts two data source objects and should return the value on which the order will depend. For example, assume that A and B objects represent two series points. If the function returns a value less than 0, point A will be drawn before point B. If the function returns a value greater than 0, point A will be drawn after point B. If the function returns 0, the drawing order of A and B remains unchanged.