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
close icon

FilterItems on Legend gives error

Hello,

I need to hide some series in the Legend (every series over index 7) and therefore use the FilterLegend Eventhendler as you describe in your support items:

Private Sub Legend_FilterItems(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Chart.ChartLegendFilterItemsEventArgs)
' This creates an new instance of the ChartLegendItemCollection
Dim items(7) As Syncfusion.Windows.Forms.Chart.LegendItem
For i As Integer = e.Items.Length - 1 To 7 Step - 1
items(i) = e.Items(i)
Next
e.Items = items

End Sub

I also tried it with:

e.Items.Clear(e.Items, 7, e.Items.Length - 7)


I also tried the eventhandler as earlier above, but without leaving out items.
In all cases I get the following error when running the code:

Source: Syncfusion.Chart.Base

Object reference not set to an instance of an object
at Syncfusion.Windows.Forms.Chart.ChartLegend.AutoSize(Rectangle rect)
at Syncfusion.Windows.Forms.Chart.ChartLegend.AutoLocation(Rectangle rect)
at Syncfusion.Windows.Forms.Chart.ChartControl.RecalculateSizes()
at Syncfusion.Windows.Forms.Chart.ChartControl.Redraw(Boolean update)
at Syncfusion.Windows.Forms.Chart.ChartControl.LegendVisibleChanged(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.OnParentVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)

We are working with version: 3.201.1.0
I saw another item on this forum with similar error notification (By dms at 6/20/2006 8:42:17 PM ). I think I need the same patch.

Could you provide me with this or do you have a workaround?

Thanx.

11 Replies

SH sh October 30, 2006 04:08 PM UTC

Correction on sent code:

Dim items(e.Items.Length) As Syncfusion.Windows.Forms.Chart.LegendItem
For i As Integer = 0 To 7
items(i) = e.Items(i)
Next
e.Items = items


I tried numerous variations, all with same error as result..


SH sh October 31, 2006 02:40 PM UTC

I now see that I could also use the custom points for what I need, but also here there seems to go something wrong. I noticed that this was brought to your attention already in another forum item: By Dmitry at 10/13/2005 10:51:17 AM :

When adding more then one custom point, the first points will take the shape/color/image of the last point, even if you declare a new custompoint variable.

Has this been solved yet and/or could this be patched to my version?

Thanx, Sandra


AD Administrator Syncfusion Team November 3, 2006 11:02 AM UTC

Hi Sansan,

I apologize for the delay in responding you.

Please take a look at the sample attached. Let me know if this helps.

ChartLegend.zip

I am working for custom points sample and will update you as soon as possible.

Thanks,
Sureshbabu


SH sh November 3, 2006 11:22 AM UTC

Hi,

It seems that the link to the zip file doesn't work.
I get a file not found message when trying to open/download the zip file.

Can you please solve this?

Thanx,
Sandra


AD Administrator Syncfusion Team November 6, 2006 04:12 AM UTC

Hi Sansan,

I regret for the inconvenience caused.

Please take a look at the sample attached. Let me know if this helps.

Chart Legend

Regards,
Sureshbabu


SH sh November 7, 2006 03:12 PM UTC

Hello,

Also here the example does not work on my version of the chart. (By the way: working with VS.NET 2003)

I adjusted the code of your example so I could compile it in my version.
I attached the result.

Also here, after removing items from the legend, the application crashes when running the form.

Can you please check this and send me a patch or a working example of custom points, please?

Thanx, Sandra



Chart Legend.zip


AD Administrator Syncfusion Team November 10, 2006 05:56 AM UTC

Hi Sansan,

Sorry for the inconvenience caused.

We are looking into it and will update you as soon as possible.

Thanks for your patience.

Thanks,
Sureshbabu


AD Administrator Syncfusion Team November 13, 2006 01:34 PM UTC

Hi Sansan,

Sorry for the inconvenience caused, and thanks for bringing this to our attention. But this issue is fixed in version v3.2.1.1 itself.

Please upgrade to latest version and try the attached sample.

Chart Legend Hiding

Once again sorry for the delay in responding you.

Regards,
Sureshbabu


AD Administrator Syncfusion Team November 14, 2006 07:48 AM UTC

Hi Sansan,

The custom point issue is also fixed in version v3.3.

So please upgrade to latest version.

Thanks for using Syncfusion products.

Regards,
Sureshbabu


SH sh November 22, 2006 08:20 AM UTC

Thank you for your reply.
Downloadnig the latest version is no option though. We are going live very soon and the latest version has too many differences to apply all within that time.

I would rather get the 3.2.1.1 version, since I need to work out the bugs. Could you please provide us with that version, so that we can continue working with Essential Chart.

Thank you.
Sandra


PJ Poly J Syncfusion Team November 27, 2006 10:18 AM UTC

Hi Sandra,

Please create a Direct-Trac incident so that I can send you the fix regarding this issue.

Regards,
Poly




Loader.
Live Chat Icon For mobile
Up arrow icon