Scatter & Categorical Series on same chart?

3 posts, 0 answers
  1. Steven
    Steven avatar
    22 posts
    Member since:
    May 2011

    Posted 08 Oct 2012 Link to this post

    Can a Scatter and Categorical Series be displayed on the same chart?

    I have a scatter series that wont display.  Is the only solution to have everything as a ScatterLine / ScatterPoint on a given chart?

    Alternatively, is it possible to have just points (i.e. no lines) in a categorical style?

    i.e. in this case everything is actually categorical i.e. Date (continuous, not strictly a category).  We just want to have points.  I bet you are going to say to do the line fill as transparent + use a point template.  Correct?  In which case how do I set a "new LineSeries()" to be transparent in code behind?

    Maybe this is it: new SolidColorBrush(Colors.Transparent);
  2. Steven
    Steven avatar
    22 posts
    Member since:
    May 2011

    Posted 08 Oct 2012 Link to this post

    fyi, this works:
                        l.BorderBrush = new SolidColorBrush(Colors.Transparent);
                        l.Stroke = new SolidColorBrush(Colors.Transparent);
    
    is there a better way?
  3. DevCraft banner
  4. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 10 Oct 2012 Link to this post

    Hello Steven,

    You are in fact correct. The reason you can't have scatter and categorical series on the same chart is that the series rely on the axes to be rendered on the correct position.
    This means that when using categorical series you need one of the two axes to be CategoricalAxis and the other - linear or logarithmic axis. And as you probably know Scatter* series need both of the axes to be numeric.

    As you have already figured out yourself, if you need a point series to be displayed in a categorical chart, set the line color to transparent and use a point template.

    Kind regards,
    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top