Welcome to the Xceed Community | Help
Community Search  

How do I use Stacked LineSeries and specify different colors for each line?

Sort Posts: Previous Next
  •  12-03-2008, 9:17 PM Post no. 17338

    How do I use Stacked LineSeries and specify different colors for each line?

    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? 

  •  12-04-2008, 11:15 AM Post no. 17348 in reply to 17338

    Re: How do I use Stacked LineSeries and specify different colors for each line?

    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;


    André
    Software Developer and Tech Support
    Xceed Software Inc.
  •  12-04-2008, 2:36 PM Post no. 17354 in reply to 17348

    Re: How do I use Stacked LineSeries and specify different colors for each line?

    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?

  •  12-04-2008, 3:10 PM Post no. 17356 in reply to 17354

    Re: How do I use Stacked LineSeries and specify different colors for each line?

    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.

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.