[DevExpress Support Team: CLONED FROM T315660: How to initialize colorizer items at runtime depending on the data source content]
It is impossible to colorize MapPie segments using the DrawMapItem event
Answers approved by DevExpress Support
We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.
Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.
The new DrawMapSegmentableItemEventArgs class is introduced. To customize segments of MapPath and MapPie with the DrawMapItem event, its EventArgs object can be cast to the DrawMapSegmentableItemEventArgs class, which has the Segments property containing an array of the Fill, Stroke, and StrokeWidth for the corresponding segment. E.g. a fill color of the odd segments of MapPie can be set with the code like this:
C#void MapControl_DrawMapItem(object sender, DrawMapItemEventArgs e) {
...
if(e.Item is MapPie) {
DrawMapSegmentableItemEventArgs args = (DrawMapSegmentableItemEventArgs)e;
for(int i = 1; i < args.Segments.Length; i += 2)
args.Segments[i].Fill = Color.Red;
}
...
}
- v15.2.4Download Official Update
- v15.1.9Download Official Update