We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Can I change the highlight color for chart data?

I find the highlight color to be too dark. It is possible to have a lighter color for the highlight effect? TIA

3 Replies

Davis Jebaraj November 4, 2004 01:50 PM UTC

Hi, The Highlight color is controlled by the HightlightInterior property of a point style. You can modify the Highlight interior for each point by setting the Style.HighlightInterior: Approach 1: Set the HighlightInterior for each point style. If a series has 10 points, you need to set the style for all 10 point styles VB.NET: Dim highlightColor As BrushInfo = New BrushInfo(Color.LightBlue) seriesCount.Styles(0).HighlightInterior = highlightColor seriesCount.Styles(1).HighlightInterior = highlightColor seriesCount.Styles(2).HighlightInterior = highlightColor seriesCount.Styles(3).HighlightInterior = highlightColor seriesCount.Styles(4).HighlightInterior = highlightColor seriesCount.Styles(5).HighlightInterior = highlightColor seriesCount.Styles(6).HighlightInterior = highlightColor seriesCount.Styles(7).HighlightInterior = highlightColor seriesCount.Styles(8).HighlightInterior = highlightColor seriesCount.Styles(9).HighlightInterior = highlightColor Approach 2 (Recommended): Use the callback approach AddHandler seriesCount.PrepareStyle, AddressOf Me.ChartControlSeries_PrepareStyle Protected Sub ChartControlSeries_PrepareStyle(ByVal sender As Object, ByVal args As ChartPrepareStyleInfoEventArgs) '' Style formatting using a callback. You can apply the same settings directly on the series style on the '' point styles. Dim series As ChartSeries = sender Dim rand As New Random() If Not (series Is Nothing) Then args.Style.HighlightInterior = New BrushInfo(Color.LightBlue) args.Handled = True End If End Sub Thanks, Davis

Davis Jebaraj November 4, 2004 01:59 PM UTC

Hi, Please refer to a sample showing both the approaches: ChartHighlightInterior_5847.zip Thanks, Davis

Administrator November 4, 2004 02:07 PM UTC

Thanks Davis, I''ll give it a try.
Loader.
Live Chat Icon For mobile
Up arrow icon