Line on value 0 invisible / hidden by the X axis line

7 posts, 1 answers
  1. Martin
    Martin avatar
    34 posts
    Member since:
    Oct 2012

    Posted 08 Jan 2015 Link to this post

    Hello,

    I'm currently trying to simulate a step line series by using two values for one state. Basically my first attempt looks like this: https://dl.dropboxusercontent.com/u/55589036/Pictures/Screenshots/20150108152425.png

    In two states my value is exactly 0 of the item in the data source of the line series and this will result in not being shown. In my opinion as long as the values are not negative the line between them should be printed.

    How can I get this done?
  2. Answer
    Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 08 Jan 2015 Link to this post

    Hello Martin,

    You can use the ZIndex and ClipToPlotArea properties of the series to get the series drawn on top of the axis.

    Note that you need the ZIndex property of the series and not the Canvas.ZIndex. Setting it to a value of 250 should suffice and now the series will be drawn on top of the axis. Optionally you can to set the ClipToPlotArea property to false in order for the series not to get clipped.

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Martin
    Martin avatar
    34 posts
    Member since:
    Oct 2012

    Posted 05 Feb 2015 Link to this post

    Sorry for bringing this up again, but I recently updated the controls to use StepLineSeries and BitmapRendering. However, when setting BitmapRendering on my StepLineSeries RenderOptions it will ignore ZIndex and ClipToPlotArea and even hide a value that is near the zero line.

    Any suggestions?
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 06 Feb 2015 Link to this post

    Hello Martin,

    When you use lighter render options there are some limitations due to how the lighter render mode works. When using bitmap, all series are drawn onto the same DrawingVisual. The drawing visual resides in a Canvas, lets call it a drawing-visual-canvas.

    When you use the default xaml rendering, setting the ZIndex is directly applied to the series, so you can control its zindex in respect to all elements of the same level (all series, axes, annotations, track ball and the drawing-visual-canvas). So you can set the ZIndex of a xaml-rendered series and it will be drawn on top (or below) the drawing-visual-canvas regardless of the zindexes of the bitmap-rendered series. The ZIndex will be respected amongst the series with the same render mode. If I was unable to provide the information needed, please send to us your exact requirements and a snapshot of the desired result and I will try to guide you into getting this done.

    The reason that the zero values of the line are not visible is not because the axis gets drawn on top of the series, but because the value is outside of the plot area. Due to that, the drawing visual resides completely between the axes and does not overlap them. This is partly a result of double calculations rounding, but as a final result I think that it is a flaw on our side and there should be a mechanism to allow for such a customization.I will put this under investigation to see if we can improve this behavior.

    Currently you can not force the chart to extend the size of the drawing visual and you will not be able to avoid this clipping. The only work-around I can think of is to extend the range of the axis. 

    I hope this information helps, let me know if you have any other questions. 

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Martin
    Martin avatar
    34 posts
    Member since:
    Oct 2012

    Posted 09 Feb 2015 in reply to Petar Marchev Link to this post

    Hey Petar,

    you absolutely got the point. Without bitmap rendering it looks like this: https://www.dropbox.com/s/fd80iynepvwk14f/Screenshot%202015-02-09%2014.55.02.png?dl=0

    See the orange chart line that has the 0 value on every point.

    With bitmap rendering it turns out to look like this: https://www.dropbox.com/s/uovf2rnv221nh2b/Screenshot%202015-02-09%2014.57.00.png?dl=0

    So it turns to be invisible on the 0 value only. It would be great if you can provide me any work around, because it's a wanted feature by our customers.

    Thank you.
  7. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 10 Feb 2015 Link to this post

    Hi Martin,

    As I suggested earlier you can extend the range of the axes, so that its Minimum is not 0, but -10, this way there will be space below the 0 value and the step line can be drawn without getting clipped.

    Another solution would be to either use xaml or direct2D rendering, where both will require a little ZIndex setting and a Margin to displace the axis. I have created a small project and I am attaching it here for your reference.

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  8. Martin
    Martin avatar
    34 posts
    Member since:
    Oct 2012

    Posted 11 Feb 2015 in reply to Petar Marchev Link to this post

    Extending the Y axis is out of question for us. Because we also need thicker lines than 1px, I will go for D2D. Thank you.
Back to Top
UI for WPF is Visual Studio 2017 Ready