Profile Picture

Custom coloring

Posted By Evgeny Kuklo 12 Years Ago
Author
Message
Evgeny Kuklo
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 2, Visits: 1
Hello, thank your for your answer. It's works perfectly!

Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Evgeny,

The stylesheet also applies settings for data label style - in order to replicate this you'll have to loop trough the data points in the pie and create an individual data label style for each data point. The following code shows how to do that:

   pie.DataLabelStyles.Clear();

   for (int i = 0; i < pie.Values.Count; i++)
   {
    NDataLabelStyle dls = (NDataLabelStyle)pie.DataLabelStyle.Clone();

    NStandardFrameStyle frame = new NStandardFrameStyle();
    Color fillColor = ((NFillStyle)pie.FillStyles[i]).GetPrimaryColor().ToColor();
    frame.InnerBorderColor = fillColor;

    dls.TextStyle.BackplaneStyle.StandardFrameStyle = frame;
    dls.ArrowStrokeStyle.Color = fillColor;

    pie.DataLabelStyles[i] = dls;
   }



Best Regards,
Nevron Support Team



Evgeny Kuklo
questionmark Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 2, Visits: 1
Good day!

I have a problem with coloring of pie pieces in pie chart.

Example: I have some list of items.
{Sum = 10, Name = "Test1"}
{Sum = 30, Name = "Test2"}
{Sum = 50, Name = "Test3"}

If I use the predefined stylesheet, the color of a piece of pie will always be different.

NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.BrightMultiColor);
styleSheet.Apply(control);

In code

Color color = ServiceColorRepository.Instance.GetFormsColor(record.Name);
NDataPoint point = new NDataPoint(record.Sum, record.Name, new NColorFillStyle(color));
pie.AddDataPoint(point);

I take a color based on the text of item. All is ok, but colors of arrows and borders of labels is always black.

How can I resolve this problem?




Similar Topics


Reading This Topic