Hi,
I seem to have a problem with a multiple-series bar chart. I have a custom X-Axis, which works fine. The Y-Axis is simply a number of phone calls figure, so the auto-scale axis would be fine. However, the values do not seem to marry up with those in the bar series. The image below illustrates this (flickr link, not sure if you can embed pics on here) :
As you can see, the rightmost green bar = 111, which seems to line up with the Y-axis - however, none of the others do.
The XAML for the chart is as follows (incomplete, the remainder is legend name, title etc):
<control:RadChart x:Name="skillBarChart" |
telerik:Theming.Theme="Office_Black" > |
<control:RadChart.DefaultView> |
<chart:ChartDefaultView > |
<chart:ChartDefaultView.ChartArea > |
<chart:ChartArea x:Name="BarChartArea" |
LegendName="CustomLegend" |
FontFamily="Arial" FontSize="18" |
Height="446.848" Width="985"> |
<chart:ChartArea.AxisX> |
<chart:AxisX MajorGridLinesVisibility="Collapsed" |
Title="Skill" /> |
</chart:ChartArea.AxisX> |
<chart:ChartArea.AxisY> |
<chart:AxisY MajorGridLinesVisibility="Collapsed" |
MinorGridLinesVisibility="Hidden" |
Title="Calls" AutoScale="True" |
MinValue="0" MaxValue="500"/> |
</chart:ChartArea.AxisY> |
<chart:ChartArea.Background> |
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> |
<GradientStop Color="#FF000000" Offset="0"/> |
<GradientStop Color="#FF63B2DE" Offset="1"/> |
</LinearGradientBrush> |
</chart:ChartArea.Background> |
</chart:ChartArea> |
</chart:ChartDefaultView.ChartArea> |
I'm populating the chart as follows (again a snippet) :
foreach (string s in skillname) |
{ |
DataPoint Idp = new DataPoint(); |
Idp.YValue = noOfInCalls[Array.IndexOf(skillname, s)]; |
Idp.XValue = Array.IndexOf(skillname, s); |
series1.Add(Idp); |
DataPoint Odp = new DataPoint(); |
Odp.YValue = noOfOutCalls[Array.IndexOf(skillname, s)]; |
Odp.XValue = Array.IndexOf(skillname, s); |
series2.Add(Odp); |
} |
skillBarChart.DefaultView.ChartArea.DataSeries.Add(series1); |
skillBarChart.DefaultView.ChartArea.DataSeries.Add(series2); |
I then reformat the X-Axis with specific values for the 'skillname' to which each Y value corresponds, but do not do anything with the Y-Axis. However, I still get the issue as shown in the image. The '120' marker in the image is also cut off by the chart title area which I cannot seem to resolve.
Any assistance gratefully received! Thanks!
Richard