Lines along minimum or maximum values of axis are not visible

5 posts, 1 answers
  1. Philip
    Philip avatar
    13 posts
    Member since:
    Mar 2015

    Posted 24 Jun Link to this post

    Hi, I have used a ScatterLineSeries inside a RadCartesianChart with both HorizontalAxis and VerticalAxis set to LinearAxis.

    The y-value shows probability of something for an elapsed time, so the only meaningful range for y-axis is 0 to 1, thus i set Minimum=0 and Maximum=1

    Multiple consecutive points have y=1, so there should be a horizontal line at the very top of the graph. But is seems it will be completely cut away and not visible. I guess it makes sense if thickness is based on (Maximum - y).

    I've tried working around by setting those values to y=0.99 and that work. I've also tried setting Maximum=1.01 and that also work.

    However the first workaround gives big problems if i want to display the actual data, and the second workaround does not work well with minimum value.

    I could set minimum value to -0.01, but then the first label will show value -0.01, and second label will show 0.09, and then 0.19 etc.

    Any idea how I can solve this?

     

  2. Answer
    Peshito
    Admin
    Peshito avatar
    496 posts

    Posted 28 Jun Link to this post

    Hello Philip,

    In order to have your series thickness fully visible, try using the series' ClipToPlotArea property set to False. For example:
    <telerik:RadCartesianChart x:Name="chart" ClipToBounds="False">
               <telerik:RadCartesianChart.HorizontalAxis>
                   <telerik:LinearAxis />
               </telerik:RadCartesianChart.HorizontalAxis>
               <telerik:RadCartesianChart.VerticalAxis>
                   <telerik:LinearAxis Minimum="0" Maximum="1"/>
               </telerik:RadCartesianChart.VerticalAxis>
               <telerik:RadCartesianChart.Series>
                   <telerik:ScatterLineSeries ClipToPlotArea="False">
                       <telerik:ScatterLineSeries.DataPoints>
                           <telerik:ScatterDataPoint XValue="1" YValue="0.5"/>
                           <telerik:ScatterDataPoint XValue="2" YValue="0.6"/>
                           <telerik:ScatterDataPoint XValue="3" YValue="0.7"/>
                           <telerik:ScatterDataPoint XValue="4" YValue="0.8"/>
                           <telerik:ScatterDataPoint XValue="5" YValue="0.9"/>
                           <telerik:ScatterDataPoint XValue="6" YValue="1.0"/>
                           <telerik:ScatterDataPoint XValue="7" YValue="1.0"/>
                           <telerik:ScatterDataPoint XValue="8" YValue="1.0"/>
                           <telerik:ScatterDataPoint XValue="9" YValue="1.0"/>
                       </telerik:ScatterLineSeries.DataPoints>
                   </telerik:ScatterLineSeries>
               </telerik:RadCartesianChart.Series>
           </telerik:RadCartesianChart>
    Hope this helps.

    Regards,
    Peshito
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Philip
    Philip avatar
    13 posts
    Member since:
    Mar 2015

    Posted 29 Jun in reply to Peshito Link to this post

    Thank you, that worked :)

    But I feel it's a bit strange that this is the default behaviour. My values are in the given range to the graph (of course including the boundary), so I think they should get displayed by default.

  5. Peshito
    Admin
    Peshito avatar
    496 posts

    Posted 01 Jul Link to this post

    Hi Philip,

    I am glad this worked well.

    This is the default behavior and the series is being clipped in order to be in the bounds of the plot area. Thank you for the feedback on the matter. I will forward it to our developers for further consideration.

    Regards,
    Peshito
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  6. Philip
    Philip avatar
    13 posts
    Member since:
    Mar 2015

    Posted 01 Jul in reply to Philip Link to this post

    Yeah, but the data is in the range [Minimum, Maximum], so I don't think it should be clipped away.

    Anyways, thanks for the good support :)

Back to Top
UI for WPF is Visual Studio 2017 Ready