This is a migrated thread and some comments may be shown as answers.

Legend item color not matching with bar color

1 Answer 64 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 07 Nov 2012, 07:51 AM
I've set UseAutoGeneratedItems = false and add in the legenditems manually by setting the color of each item randomly.
How do I get the legenditem color to match the bar color

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 08 Nov 2012, 09:34 AM
Hello Oliver,

I have attached a very simple project for your reference. The project does not have the UseAutoGeneratedItems property set to false. I have just attached it to show you that an output similar to yours is possible without manually adding legend items.

Can you explain what is your scenario? Why do you need to add the legend items manually? Is it possible that you use the approach in the attached project?

If you demand to add items in the legend manually - you might need to define chart palette brushes. The chart will use these brushes for the bars and you can use these brushes for the legend items.   

All the best,
Petar Marchev
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Oliver
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or