Line Series & Negative Values

6 posts, 0 answers
  1. Neil Burrows
    Neil Burrows avatar
    3 posts
    Member since:
    Nov 2005

    Posted 22 Feb 2012 Link to this post

    When I plot a line series with negative values, the negative points do not get plotted. XAML is below.

    <telerik:RadCartesianChart Palette="Metro"  HorizontalAlignment="Stretch"  >
      <telerik:LineSeries CategoryBinding="X" ValueBinding="Y" ItemsSource="{Binding Data}" />
      <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:DateTimeContinuousAxis ShowLabels="False" />
      </telerik:RadCartesianChart.HorizontalAxis>
      <telerik:RadCartesianChart.VerticalAxis>
          <telerik:LinearAxis ShowLabels="False"  />
        </telerik:RadCartesianChart.VerticalAxis>
    </telerik:RadCartesianChart>

    For one of my data series, there are no positive Y values, which results in a blank chart.  

    Problem with the auto setting of ranges I suspect?

    Can any one at Telerik suggest a usable workaround?
  2. Neil Burrows
    Neil Burrows avatar
    3 posts
    Member since:
    Nov 2005

    Posted 22 Feb 2012 Link to this post

    The plot thickens:

    The chartview is height restricted in the wpf grid it is contained.  The chart's panel doesn't seem to be adjusted to fit. The container area is really restricted as it's part of a dashboard showing rather a lot of relevant information.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Neil Burrows
    Neil Burrows avatar
    3 posts
    Member since:
    Nov 2005

    Posted 23 Feb 2012 Link to this post

    So the issues is, the view area with the datapoints isn't centred on where there datapoints are drawn and it isn't scaled correctly.

    What are my options? 
  5. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 24 Feb 2012 Link to this post

    Hello Neil,

    We have tested chartview line series with only negative, only positive and mixed data and it works as expected. I have prepared for you a small runnable application that demonstrates this. Please run it in your environment and check if everything is working fine. If you are unable to resolve this issue will it be possible for you to share more details on your project? As sample project and data that reproduces this issue can be very helpful.

    Greetings,
    Yavor
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. Gareth McNicol
    Gareth McNicol avatar
    22 posts
    Member since:
    Nov 2006

    Posted 29 Feb 2012 Link to this post

    Few issues:

    1) the latest version of your product wasn't used in the example, odd.
    2) the height wasn't constrained like I had stated.

    Updated mainwindow.xaml

    <Window x:Class="WpfApplication1.MainWindow"
            Title="MainWindow" Height="350" Width="525">
        <Grid Height="80">
            <telerik:RadCartesianChart Name="chart" BorderBrush="Red" BorderThickness="1" Height="75">
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis />
                </telerik:RadCartesianChart.VerticalAxis>
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:DateTimeContinuousAxis ShowLabels="False" />
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:LineSeries CategoryBinding="Item1" ValueBinding="Item2" />
                <telerik:LineSeries CategoryBinding="Item1" ValueBinding="Item2" />
            </telerik:RadCartesianChart>
        </Grid>
    </Window>

    Setting the height on the rad chart does nothing. Same with max height, min height etc, doesn't have any effect, it does not respect the bottom boundry of the grid.  You can see as much in the screenshot attached, the bottom of the red border isn't visible.

  7. Gareth McNicol
    Gareth McNicol avatar
    22 posts
    Member since:
    Nov 2006

    Posted 29 Feb 2012 Link to this post

    Aaaah.  Setting MinHeight does solve it.  Inexplicably set to 100 by default.
Back to Top
UI for WPF is Visual Studio 2017 Ready