David V
-
Posts
5 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by David V
-
-
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.
-
I fixed the isse by casting the X value to int.
-
When I plot the following values the last point is missing from the chart.
But when I change the X values by dividing (or multiplying) by 10, the point appears.
I am populating the values like this
chart1.Data.X[index] = x;
chart1.Data.Y[seriesIndex, index] = y;
-
I can not get the header values in the datagrid to change from points to the values.
I am populating the XValues
foreach (VolData vol in data_){chart1.Data.X[index] = vol.Expiry.ToOADate();
index++;
}
and have set the XValuesAsHeaders flag
chart1.DataGrid.XValuesAsHeaders =
true;
How to not highlight a particular series
in Windows Forms
Posted
I fixed it by replacing the resolver
{
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();
}
}