Customizing Axis Labels using Axis.AnnoCreated Event

To set the colors of the labels depending upon its values, use the following code:

 

chart.View.AxisY.AnnoCreated += (s, e) =>

{

var label = (TextBlock)e.Label;

if (e.Value >= 0)

label.Foreground = Brushes.Red;

else

label.Foreground = Brushes.Blue;

};


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.