Home Forums WinForms controls Xceed Chart for WinForms How do I use Stacked LineSeries and specify different colors for each line?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19062 |

    Currently i’m using something like the following:

    LineSeries lineSeries = (LineSeries)parentChart.Series.Add(SeriesType.Line);
    lineSeries.Name = seriesName;
    lineSeries.DataLabels.Mode =
    DataLabelsMode.None;
    lineSeries.Markers.Style =
    PointStyle.Cone;
    lineSeries.Appearance.FillMode = AppearanceFillMode.Series;
    lineSeries.Appearance.LineMode =
    AppearanceLineMode.Series;
    lineSeries.LineFillEffect.SetSolidColor(colorOfLine);
    lineSeries.Legend.Mode = SeriesLegendMode.Series;

    Right now, I can see the multiple lines but they are all black, even in the legend.
    I feel like I’m really missing something here but according to the document, this should work.
    What am i doing wrong? 

    Imported from legacy forums. Posted by Jay (had 3195 views)

    User (Old forums)
    Member
    Post count: 23064

    The LineFillEffect is for the inside part of the line when the LineStyle is set to something other than Line (e.g. Tape) and the chart is set to 3D.  What you need is to set the LineBorder property.

    e.g.:

    lineSeries.LineBorder.Color =

    Color.DodgerBlue;

    Imported from legacy forums. Posted by André (had 239 views)

    User (Old forums)
    Member
    Post count: 23064

    Oh ok. so that solves the problem of line colors.
    But one other thing that I’ve been having trouble with is setting markers on these lines.
    Here is what I am doing currently:

    lineSeries.Markers.Style = PointStyle.Sphere;

    But nothing show up for the data points.
    What is the proper way to set different Marker shapes?

    Imported from legacy forums. Posted by Jay (had 388 views)

    User (Old forums)
    Member
    Post count: 23064

    Hm. Never mind, it’s now working.
     

    lineSeries.Markers.Border.Color = colorOfLine;
    lineSeries.Markers.Visible =
    true;
    lineSeries.Markers.Style =
    PointStyle.Sphere;

    This did the trick. Not sure why it wasn’t working before though.

    Imported from legacy forums. Posted by Jay (had 3838 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.