Jump to content
Software FX Community

Is there way to customize the user defined color to legend items instead of using the pre-defined palette colors.


madhu
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...

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 

 

 

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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 

Posted Image

<img src="http://dev.einstruction.com:8080/secure/attachment/21003/Palette+color+not+updating.JPG">

</body>

</html>

Link to comment
Share on other sites

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. :-)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...