madhu Posted October 30, 2008 Report Share Posted October 30, 2008 How do I customize to set the user defined color to legend items instead of using palette selected colors. When we are selecting the palette color it will update into the legend items color but I have requirement to customize the legend items color using user defined colors in the legend object.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> Thanks, Madhu Quote Link to comment Share on other sites More sharing options...
Frank Posted November 3, 2008 Report Share Posted November 3, 2008 You can assign any color to any item in the chart. You are not limited to the current palette. Items assigned a color will no longer change when the palette is changed. Quote Link to comment Share on other sites More sharing options...
madhu Posted November 3, 2008 Author Report Share Posted November 3, 2008 How to apply the user defined colors in the legend instead of using palette template colors. Example: we have to display the four coloumns item data in the bar chart. So first 3 columns data need to display in "Red" color and other item need to display in "Green" color. So the updated bar items color need to change in the legend items also. Thanks, Madhu Quote Link to comment Share on other sites More sharing options...
madhu Posted November 3, 2008 Author Report Share Posted November 3, 2008 We have the ability to change the color of the bars at run-time - however, we don't yet know the way to change the colors of the legend items (to match the new bar colors) at run-time. Is there a method to change the legend items at run-time as well? Quote Link to comment Share on other sites More sharing options...
madhu Posted November 17, 2008 Author Report Share Posted November 17, 2008 Is there any follow-up to this?We would really like to be able to work out this issue before our product ships next. Quote Link to comment Share on other sites More sharing options...
TomasT Posted November 18, 2008 Report Share Posted November 18, 2008 Hi, The color of the series is actually linked to the color shown in the legendbox. The legendbox should reflect any changes done to the series' color, even if the change is done with the Run-time UI. Are you saying that after changing the color of your series, the legendbox is not refreshing the color? If so, how are you changing the color? Are you doing it through code? Please provide a snippet of code where you are setting this. There is a fully workable sample project in the Resource Center that shows how to work with seris colors and Per-Series attributes in general. You can find it in: ChartFX Programmer's Guide > Visual Attributes > Per-Series Attributes. Regards, TT Quote Link to comment Share on other sites More sharing options...
madhu Posted November 28, 2008 Author Report Share Posted November 28, 2008 Hi, We want to change the Legend color with our user-defined colors. Normally when we select the series of colors it will reflect into the legend items color. We have requirement to create user defined color series and apply to the legend items. We need to show 3 items as one color and other with different color in legend. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />Please help the solution to solve the problem. Thanks, Madhu Quote Link to comment Share on other sites More sharing options...
madhu Posted December 1, 2008 Author Report Share Posted December 1, 2008 Below is the screen shot of our application. Here what we are looking at is provision to set the legend colors Green for option A and blue for options B and C. If we use the series index it sets different colors for each of the options A, B and C. Please suggest if you have a solution <img src="http://dev.einstruction.com:8080/secure/attachment/21003/Palette+color+not+updating.JPG"> </body> </html> Quote Link to comment Share on other sites More sharing options...
TomasT Posted December 4, 2008 Report Share Posted December 4, 2008 Hi, Can you please repost or update picture you submitted above? A screnshot would definitely help us understand what you are seeing and what you are looking for. Regards, TT Quote Link to comment Share on other sites More sharing options...
rkw6086 Posted December 4, 2008 Report Share Posted December 4, 2008 Madhu, We have the same issue. After looking over custom pallets, it doesn't look like you can specify which color goes on which series. We solved this solution by cycling through each series in code during initialization, matching it's title to our specifications, and then setting the Series Attributes properties to match what we want. This is going to be the best possible way to update your chart colors. The only way I think you can accomplish this with Pallets is if you know the order of your series each time. If thats the case, then give pallets a try. :-) Quote Link to comment Share on other sites More sharing options...
madhu Posted December 8, 2008 Author Report Share Posted December 8, 2008 Hi , Please find the image URL in the below path. Let me know if you still getting the problem. http://picasaweb.google.com/madhu.anumalasetty/EInstruction#5277329085163581922 Thanks, Madhu Quote Link to comment Share on other sites More sharing options...
TomasT Posted December 10, 2008 Report Share Posted December 10, 2008 Ok. The image you provided is still not clear. I any case, you can customize the items in the legendbox as needed: chart1.LegendBox.ItemAttributes.Clear();CustomLegendItem c = new CustomLegendItem();c.Text = "Custom Item";c.MarkerShape = MarkerShape.Marble;c.Color = Color.Orange;chart1.LegendBox.CustomItems.Add©;Does this help? TT WPFRunChartSample1.zip Quote Link to comment Share on other sites More sharing options...
madhu Posted December 22, 2008 Author Report Share Posted December 22, 2008 Hi , The above code didn't help us. Please find the below updated image url and let me know if you are able to see the image http://picasaweb.google.com/madhu.anumalasetty/EInstruction#5282555981985614418 Thanks, Madhu Quote Link to comment Share on other sites More sharing options...
madhu Posted March 4, 2009 Author Report Share Posted March 4, 2009 Hi, Please help to us, how can we set the user-defined colors in the legend box attributes. Thanks, Madhu Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.