I have changed the Label on the Trackball to the data I want to display. In this case it is 4 lines. I would like to change the color of each line of text individually. I can change the color of all of the text in the label, but not on a line by line basis. Here is a snippet of my code:
ChartTrackballController trackBallController =
new
ChartTrackballController();
trackBallController.TextNeeded += TrackBallController_TextNeeded;
radChartView1.Controllers.Add(trackBallController);
private
void
TrackBallController_TextNeeded(
object
sender, TextNeededEventArgs e)
{
CategoricalDataPoint dataPoint1 = e.Points[0].DataPoint
as
CategoricalDataPoint;
CategoricalDataPoint dataPoint2 = e.Points[1].DataPoint
as
CategoricalDataPoint;
e.Element.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
e.Element.ForeColor = System.Drawing.Color.Blue;
float
difference = Math.Abs((
float
)dataPoint1.Value - (
float
)dataPoint2.Value);
e.Text =
string
.Format(
"Line1: {0}\nLine2: {1}\nLine3: {2}\nLine4: {3}"
, dataPoint1.Category, dataPoint1.Value, dataPoint2.Value, difference);
}