Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1140
Change Legend Items Foreground Property?
posted

Whats the deal with the foreground properties?  Most seem to be completely useless.  That is of course excluding the fact that I am a complete newb to infragistics chart controls period, silverlight or other wise.

So here's what I got (Which Does not change the foreground property)

 

foreach

 

(LegendItem li in XamChart.Legend.Items)

{

li.Foreground =

new SolidColorBrush(Colors.White);

}

Parents
No Data
Reply
  • 27093
    Verified Answer
    posted

    Hello Danny,

    You can set this trough style and it works both from xaml and code behind. I did it like so:

     

    Style style = new Style(typeof(LegendItem));

    Setter set = new Setter(LegendItem.ForegroundProperty, new SolidColorBrush(Colors.Yellow));

    style.Setters.Add(set);

    //xamWebChart1.Legend.LegendItemStyle = litem;

     

    foreach (LegendItem item in xamWebChart1.Legend.Items)

    {

       //item.Style = style;

    }

     

    Just uncomment one. It worked both ways in my sample project.

     

    Sincerely,

    Petar Monov

    Developer Support Engineer,

    Infragistics, Inc

Children
No Data