Profile Picture

different colors in a line series

Posted By Manal Goyal 6 Years Ago
Author
Message
Manal Goyal
Question Posted 6 Years Ago
View Quick Profile
Forum Member

Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)

Group: Forum Members
Last Active: 5 Years Ago
Posts: 29, Visits: 405
Hi,
I have a LineSeries which goes from -2 to 2 on x axis, I want to color the part of the series from -2 to 0 on x axis in red and the part from 0 to 2 in blue. How can I achieve that.

Thank you.


Nevron Support
Posted 5 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: Today @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Manal,
You can assign different stroke style per line segment using the BorderStyles collection of the series - for example:
   NChart chart = nChartControl1.Charts[0];
    NLineSeries line = new NLineSeries();

    line.Values.Add(1);
    line.BorderStyles[0] = new NStrokeStyle(Color.Red);
    line.Values.Add(2);
    line.Values.Add(3);

    chart.Series.Add(line);
will draw a line where the first segment is in different color. 



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic