In a chart legend, I would like to change the background color of an item in the list based on some business logic.
For example. Lets say I have 3 series's showing in a chart legend. I would like to maybe change the background color to gray of the 3rd item in the Legend while leaving the other 2 alone.
1. Is there anyway to do this with the existing code?
2. If not, is there a simple source code change we could make to accomplish this? We own the source.
3. If #1 or #2 not possible, I have looked at the ChartListBox control. It does not appear to have this capability either.
Color background of items in a legend
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Mike,
Please find below the answers to your questions:
1. I can think of a way to do that using chart's legend at the moment.
2. I think it's probable. However we don't support source code customizations.
3. Yes, ChartListBox can do that using SelectedIndex or SetSelected, for example:
Please find below the answers to your questions:
1. I can think of a way to do that using chart's legend at the moment.
2. I think it's probable. However we don't support source code customizations.
3. Yes, ChartListBox can do that using SelectedIndex or SetSelected, for example:
Code: Select all
chartListBox1.SetSelected(0, false);
chartListBox1.SetSelected(1, true);
//or
//chartListBox1.SelectedIndex = 1;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
chartListBox1.SetSelected()
If I do
chartListBox1.SetSelected(1);
I would assume I could not select more than 1 item at a time. I failed to make that clear in my previous post.
Let's say I wanted both the 1st and last items to have a different background. I would like to be able to do something like:
chartListBox1.Items[0].BackGround = System.Drawing.Color.Gray;
chartListBox1.Items[2].BackGround = System.Drawing.Color.Gray;
Making both items background gray at the same time.
Do you have any advise on how I might be able to do that?
I would actually do this one time as the list box it loaded up. I would not need to change the background color after initially loads.
chartListBox1.SetSelected(1);
I would assume I could not select more than 1 item at a time. I failed to make that clear in my previous post.
Let's say I wanted both the 1st and last items to have a different background. I would like to be able to do something like:
chartListBox1.Items[0].BackGround = System.Drawing.Color.Gray;
chartListBox1.Items[2].BackGround = System.Drawing.Color.Gray;
Making both items background gray at the same time.
Do you have any advise on how I might be able to do that?
I would actually do this one time as the list box it loaded up. I would not need to change the background color after initially loads.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Mike,
Yes, using ChartListBox you can select more than one item at a time, for example:
Yes, using ChartListBox you can select more than one item at a time, for example:
Code: Select all
chartListBox1.SetSelected(0, true);
chartListBox1.SetSelected(1, true);
//or
//chartListBox1.SelectedIndex = 0;
//chartListBox1.SelectedIndex = 1;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |