Group: Forum Members
Last Active: 4 Years Ago
Posts: 49,
Visits: 179
|
I have created Series with following fill style as:
chartSeries.FillStyle = new NColorFillStyle(Color.Red);
But, Color fillColor = (chart.Series[i] as NSeries).FillStyle.GetPrimaryColor().ToColor();
When i compare this with this fillColor == Color.Red. It returns false.
Why these doesn't match, even i have converted return NColor object to Color using it's method ToColor().
Any Help will be appreciated.
Thanks in Advance.
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Niranjan, You're comparing a named color with an explicitly specified color. To improve performance nevron controls rarely stroke .NET color instances - instead they simply store ARGB information, without names. The following .NET code also returns false as the name of the second color is "ffff0000": bool result = (Color.Red == Color.FromArgb(255, 0, 0)); // result is false
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 49,
Visits: 179
|
Hi,
Thanks for your reply, i understand that what is going wrong.
Well i have solved this problem as:
Color x = (chart.Series[i] as NSeries).FillStyle.GetPrimaryColor().ToColor(); Color y = NColor.FromString(PreDefinedSeriesColors[i].Name).ToColor();
and comparison of x and y returns true.
Regards, Niranjan
|