Multiple YAxes not showing up

2 posts, 0 answers
  1. N Ahmed
    N Ahmed avatar
    1 posts
    Member since:
    Nov 2009

    Posted 11 Dec 2009 Link to this post


    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.




    UserControl x:Class="Innovation_Navigation.ProductValueView"























    <Grid x:Name="LayoutRoot" Background="White">












    <RowDefinition Height="*"></RowDefinition>




    <RowDefinition Height="50"></RowDefinition>








    <!-- 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"/>








    <Button Content="Main Page" Grid.Row="1" Height="30" Width="100" Click="Button_Click"></Button>

















    Code Behind



    internal void FillProductData()








    "Total Value per Product", "primary"));



    "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;




    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;




    return productCountSeries;





  2. Ves
    Ves avatar
    2926 posts

    Posted 15 Dec 2009 Link to this post

    Hi N Ahmed,

    You need to add an AxisY obejct to the AdditionalAxes collection of the ChartArea. You need to set the AxisName property of this axis, so that you can populate the SeriesDefinition.AxisName property with the same value. You can find an example here - Multiple Y Axis Support.

    Best regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top