I am having problems displaying multiple y axes on the Telerik RadChart.
Basically I want the x axis to display my product name and two y axes representing number of transactions and total value (barchart)
However both my sets of points are using the same Y axis
Here is the code.Can anyone tell me what am i doing wrong.
XAML
<
UserControl x:Class="Innovation_Navigation.ProductValueView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerikCharting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
xmlns:telerikChart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls">
<ScrollViewer>
<Grid x:Name="LayoutRoot" Background="White">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
</Grid.RowDefinitions>
<!-- Bar Chart-->
<telerikChart:RadChart Grid.Row="0" UseDefaultLayout="True" telerik:StyleManager.Theme="Office_Black">
<telerikCharting:ChartArea x:Name="ProductValueChart"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Black"/>
</telerikChart:RadChart>
<Button Content="Main Page" Grid.Row="1" Height="30" Width="100" Click="Button_Click"></Button>
</Grid>
</Grid>
</ScrollViewer>
</
UserControl>
Code Behind
internal void FillProductData()
{
ProductValueChart.DataSeries.Add(GenerateValueDataSeries(
"Total Value per Product", "primary"));
ProductValueChart.DataSeries.Add(GenerateCountDataSeries(
"Transaction Count Per Product", "secondary", new BarSeriesDefinition()));
}
private DataSeries GenerateValueDataSeries(string legendLabel, string axisName)
{
DataSeries productValueSeries = new DataSeries();
//productValueSeries.Definition = definition;
productValueSeries.LegendLabel = legendLabel;
//productValueSeries.Definition.AxisName = axisName;
foreach (ProductTotalValue currProductValue in _productViewModel.productValueList)
{
DataPoint point = new DataPoint();
point.XCategory = currProductValue.Name;
point.YValue = currProductValue.TotalValue;
productValueSeries.Add(point);
}
return productValueSeries;
}
private DataSeries GenerateCountDataSeries(string legendLabel, string axisName, ISeriesDefinition definition)
{
DataSeries productCountSeries = new DataSeries();
//productCountSeries.Definition = definition;
productCountSeries.LegendLabel = legendLabel;
// productCountSeries.Definition.AxisName = axisName;
foreach (ProductCount currProductCount in _productViewModel.productCountList)
{
DataPoint point = new DataPoint();
point.XCategory = currProductCount.productName;
point.YValue = currProductCount.transactionCount;
productCountSeries.Add(point);
}
return productCountSeries;
}