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

BarSeries Data is invisible?

1 Answer 66 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 20 Feb 2012, 10:57 PM
In an effort to create a Histogram chart, I was instructed to use a BarSeries by someone on this forum, and set it's CategoricalAxis.GapLength to 0.000001 (can't set to 0 because of a known bug). After doing this, I created a BarSeries and set it's data to what I thought would correct. I can see the y axis growing at the correct rate, but there are no bars visible!

Xaml:

<telerik:RadCartesianChart x:Name="RadChart1" Palette="Metro" HorizontalAlignment="Right" VerticalAlignment="Top" Width="1000" Height="400">
  <telerik:BarSeries ItemsSource="{Binding Data}" ValueBinding="Data"/>
  <telerik:RadCartesianChart.HorizontalAxis>
    <chartView:CategoricalAxis MajorTickInterval="250" GapLength="0.00001"/>
  </telerik:RadCartesianChart.HorizontalAxis>    
  <telerik:RadCartesianChart.VerticalAxis>
    <telerik:LinearAxis LabelFormat="0"/>
  </telerik:RadCartesianChart.VerticalAxis>    
  <telerik:RadCartesianChart.Grid>
    <telerik:CartesianChartGrid MajorLinesVisibility="Y" />
  </telerik:RadCartesianChart.Grid>
</telerik:RadCartesianChart>


The data is formatted in an ObserveableCollection<ChartData> as defined here:

public class ChartData
{
  public int Index  {  getset;  }
  public int Data  {  getset;  }
}

(I'd previously used this format for a ScatterSeries with no issue)

The graph is growing, but it's like there is no default style applied to the BarSeries, thoughts?

1 Answer, 1 is accepted

Sort by
0
Ben
Top achievements
Rank 1
answered on 21 Feb 2012, 04:17 PM
Resolved: Individual bars in a BarSeries chart have a minimum width they can be displayed at, (seemingly about 1px per bar). If you scale your chart small enough that it violates this size, the entire data series becomes invisible (as they are all then violating the min-width)
Tags
ChartView
Asked by
Ben
Top achievements
Rank 1
Answers by
Ben
Top achievements
Rank 1
Share this question
or