Tobias Posted January 21, 2009 Report Share Posted January 21, 2009 Hi! I have a gannt-chart which I would like to set different colors on the bars depending on a value different from the actual bar. Lets say i have 3 incoming values: x = name of bar y = value of bar z = value to determine color, could be 1,2,3 or "black", "red", "green"... I've checked out the ConditionalAttributes-class but it seems that it needs to use the value of the actual bar. Any advise would be appreciated! Quote Link to comment Share on other sites More sharing options...
AndreG Posted January 21, 2009 Report Share Posted January 21, 2009 I can think of two ways you can do this. You could add a dummy condition to the ConditionalAttributes collection (chart1.ConditionalAttributes.Add(new ConditionalAttributes()) then use the event chart1_ConditionalAttributesCallback to iterate through every point and evaluate your own condition. This can also be done if you implement the PaintMarker event. Quote Link to comment Share on other sites More sharing options...
Tobias Posted January 27, 2009 Author Report Share Posted January 27, 2009 Hello Andre and thank you for your reply. I'm still struggling with the ConditionalAttributesCallback. I've got the method to work on point-based valued with ex: if (Chart1.Data.Y[e.Series, e.Point] == 13){ e.Attributes = 1;}...which applies the settingsĀ of index 1 of the conditional attribute collection. What I don't get is how to use another value than the actual value of the bar. I've searched the resource center and forums to find answers but I'm obviously missing some part of the part on how to use the Tag-attribute or something. Any point in the right direction would be appreciated! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.