David V Posted August 22, 2008 Report Share Posted August 22, 2008 I want to be able to unhighlight a particular series. Currentlt I am doing the following private void chart1_Highlighting(object sender, HighlightingEventArgs e) { Debug .WriteLine(string.Format("Highlighting {0}",e.Series)); if (e.Series ==1){ chart1.Highlight.ClearHighlight(sender); } } but the problem is the other series don't get highlighted again, unless I click the chart again. I can see the highlight event stop firring. Quote Link to comment Share on other sites More sharing options...
kdarby Posted August 27, 2008 Report Share Posted August 27, 2008 I would also be interested in a solution. I have tried the above with an else which includes HighlightItem, but it crashes saying that e.series is -1. Thanks Quote Link to comment Share on other sites More sharing options...
David V Posted August 28, 2008 Author Report Share Posted August 28, 2008 I fixed it by replacing the resolver if (e.Series ==1) { if (!(e.Resolver is NullHighlightResolver)) { if (_nullHighlightResolver == null) { _nullHighlightResolver = new NullHighlightResolver(e.Resolver); } e.Resolver = _nullHighlightResolver; } } //Disable hightlight on an item public class NullHighlightResolver : IHighlightResolver { private readonly IHighlightResolver _resolver; public NullHighlightResolver(IHighlightResolver resolver_) { _resolver = resolver_; } public HighlightState GetState(HighlightType itemType, object item) { return HighlightState.Never; } public Highlightable CanHighlight(HighlightType itemType, object item) { return Highlightable.No; } public bool OnKey(bool down, KeyEventArgs args) { return _resolver.OnKey(down, args); } public HighlightingEventArgs GetHighlightingEventArgs() { return _resolver.GetHighlightingEventArgs(); } } 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.