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

Displaying extra YAxis scale on the right

1 Answer 49 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Michel
Top achievements
Rank 1
Michel asked on 04 Jun 2012, 05:20 PM
Hi,

I was able to set 2 series for YAxis based on samples found on this site.

Right now only one scale is calculated and displayed on the left for both YAxis series...

I am looking for a way to display second YAxis scale on the right side of chart area.

Thanks !

<!-- Start Graphic Control -->
 <telerik:RadChart ItemsSource="{Binding GraphicValueList}"  x:Name="chart" HorizontalAlignment="Stretch">
     <telerik:RadChart.SeriesMappings>
         <!--Pen 1 Y-Axis-->
         <telerik:SeriesMapping CollectionIndex="0">
             <telerik:SeriesMapping.SeriesDefinition>
                 <telerik:LineSeriesDefinition ShowItemLabels="False" />
             </telerik:SeriesMapping.SeriesDefinition>
  
            <telerik:SeriesMapping.GroupingSettings>
                 <telerik:GroupingSettings>
                     <telerik:GroupingSettings.GroupDescriptors>
                         <telerik:ChartGroupDescriptor Member="PenName" />
                     </telerik:GroupingSettings.GroupDescriptors>
                 </telerik:GroupingSettings>
             </telerik:SeriesMapping.GroupingSettings>
 
            <telerik:ItemMapping DataPointMember="XValue" FieldName="ProductionDate" />
             <telerik:ItemMapping DataPointMember="YValue" FieldName="GenericValue"  />
 
        </telerik:SeriesMapping>
 
        <!--Pen 2 Y-Axis-->
         <telerik:SeriesMapping CollectionIndex="1"  >
             <telerik:SeriesMapping.SeriesDefinition>
                 <telerik:LineSeriesDefinition ShowItemLabels="False" AxisName="Pen2" />
             </telerik:SeriesMapping.SeriesDefinition>
 
            <telerik:SeriesMapping.GroupingSettings>
                 <telerik:GroupingSettings>
                     <telerik:GroupingSettings.GroupDescriptors>
                         <telerik:ChartGroupDescriptor Member="PenName" />
                     </telerik:GroupingSettings.GroupDescriptors>
                 </telerik:GroupingSettings>
             </telerik:SeriesMapping.GroupingSettings>
 
            <telerik:ItemMapping DataPointMember="XValue" FieldName="ProductionDate" />
             <telerik:ItemMapping DataPointMember="YValue" FieldName="GenericValue" />
 
        </telerik:SeriesMapping>
 
    </telerik:RadChart.SeriesMappings>
  
    <telerik:RadChart.DefaultView >
         <telerik:ChartDefaultView >
 
            <telerik:ChartDefaultView.ChartLegend>
                 <telerik:ChartLegend x:Name="legend" VerticalAlignment="Top" HorizontalAlignment="Center" >
                 </telerik:ChartLegend>
             </telerik:ChartDefaultView.ChartLegend>
 
            <telerik:ChartDefaultView.ChartArea>
                 <telerik:ChartArea LegendName="legend" EnableAnimations="False">

 
                    <telerik:ChartArea.AxisX>
                         <telerik:AxisX Title="Date" MinorTicksVisibility="Collapsed" IsDateTime="True" />
                     </telerik:ChartArea.AxisX>
 
                    <!--Pen 1 Y-Axis-->
                     <telerik:ChartArea.AxisY>
                         <telerik:AxisY Title="Pen 1 Values" MinorTicksVisibility="Collapsed">
                         </telerik:AxisY>
                     </telerik:ChartArea.AxisY>
 
                    <!--Pen 2 Y-Axis-->
                     <telerik:ChartArea.AdditionalYAxes>
                         <telerik:AxisY AxisName="Pen2" Title="Pen 2 Values" MinorTicksVisibility="Collapsed">
                         </telerik:AxisY>
                     </telerik:ChartArea.AdditionalYAxes>
 
                </telerik:ChartArea>
             </telerik:ChartDefaultView.ChartArea>
         </telerik:ChartDefaultView>
     </telerik:RadChart.DefaultView>
 </telerik:RadChart>
 <!-- End Graphic Control -->


1 Answer, 1 is accepted

Sort by
0
Rosko
Telerik team
answered on 06 Jun 2012, 07:46 AM
Hello Michel,

I looked through your code and can say that everything is good with it. How the scales look depends on the range of values in the series. If you have in your first series a range of 0 to 1000 and for the second - 0 to 100, you will see that the two Y Axes have different scales. I hope you will find this helpful.
 In case, I have not understood your question, can you please explain with more details what you are trying to achieve and send us a sample runnable project with what you tried up to now? I will really appreciate if you send a screenshot of what you are getting and another picture or a drawing of what you are trying to get.

All the best,
Rosko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Chart
Asked by
Michel
Top achievements
Rank 1
Answers by
Rosko
Telerik team
Share this question
or