This is a migrated thread and some comments may be shown as answers.

Line Series & Negative Values

5 Answers 88 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Neil Burrows
Top achievements
Rank 1
Neil Burrows asked on 22 Feb 2012, 04:26 PM
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?

5 Answers, 1 is accepted

Sort by
0
Neil Burrows
Top achievements
Rank 1
answered on 22 Feb 2012, 06:17 PM
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.
0
Neil Burrows
Top achievements
Rank 1
answered on 23 Feb 2012, 11:43 AM
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? 
0
Yavor
Telerik team
answered on 24 Feb 2012, 06:08 PM
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 >>
0
Gareth McNicol
Top achievements
Rank 1
answered on 29 Feb 2012, 04:58 PM
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.

0
Gareth McNicol
Top achievements
Rank 1
answered on 29 Feb 2012, 05:01 PM
Aaaah.  Setting MinHeight does solve it.  Inexplicably set to 100 by default.
Tags
ChartView
Asked by
Neil Burrows
Top achievements
Rank 1
Answers by
Neil Burrows
Top achievements
Rank 1
Yavor
Telerik team
Gareth McNicol
Top achievements
Rank 1
Share this question
or