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

Months on the AxisX

2 Answers 76 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Natália
Top achievements
Rank 1
Natália asked on 05 Jul 2010, 07:02 PM
Hi,

I am working on a graph where use Scroll Bar, and the Y axis I would like them to appear monthly.
For some reason the points are repeated.

Following is the code for evaluation.                         XAML
<Telerik_Windows_Controls:RadChart.DefaultView> 
                <Telerik_Windows_Controls_Charting:ChartDefaultView ChartLegendPosition="Top">  
                    <Telerik_Windows_Controls_Charting:ChartDefaultView.ChartTitle> 
                        <Telerik_Windows_Controls_Charting:ChartTitle Content="Gráfico" Background="#FFFDFDFD" BorderBrush="{x:Null}" Foreground="Black"/>  
                    </Telerik_Windows_Controls_Charting:ChartDefaultView.ChartTitle> 
                      
                    <Telerik_Windows_Controls_Charting:ChartDefaultView.ChartArea> 
                        <Telerik_Windows_Controls_Charting:ChartArea Width="500" Background="#FFFBFBFB" EnableAnimations="False" SmartLabelsEnabled="False" > 
                            <Telerik_Windows_Controls_Charting:ChartArea.AxisX> 
                                <Telerik_Windows_Controls_Charting:AxisX LayoutMode="Between" IsDateTime="True" DefaultLabelFormat="MMM"/>  
                            </Telerik_Windows_Controls_Charting:ChartArea.AxisX> 
                              
                            <Telerik_Windows_Controls_Charting:ChartArea.ZoomScrollSettingsX> 
                                <Telerik_Windows_Controls_Charting:ZoomScrollSettings RangeStart="0" RangeEnd="0.5" ScrollMode="ScrollOnly">  
                                </Telerik_Windows_Controls_Charting:ZoomScrollSettings> 
                            </Telerik_Windows_Controls_Charting:ChartArea.ZoomScrollSettingsX> 
                                                                                                      
                            <Telerik_Windows_Controls_Charting:ChartArea.AxisY> 
                                <Telerik_Windows_Controls_Charting:AxisY StripLinesVisibility="Collapsed"/>                           
                            </Telerik_Windows_Controls_Charting:ChartArea.AxisY> 
                              
                        </Telerik_Windows_Controls_Charting:ChartArea> 
                    </Telerik_Windows_Controls_Charting:ChartDefaultView.ChartArea> 
                      
                </Telerik_Windows_Controls_Charting:ChartDefaultView> 
            </Telerik_Windows_Controls:RadChart.DefaultView> 
              
              
            <Telerik_Windows_Controls:RadChart.SeriesMappings> 
                <Telerik_Windows_Controls_Charting:SeriesMapping x:Name="Serie1" LegendLabel="ValorA">    
                    <Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                        <Telerik_Windows_Controls_Charting:StackedBarSeriesDefinition ShowItemLabels="False" ShowItemToolTips="True" StackGroupName="2009"  />    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                      
                    <Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="XValue" FieldName="Mes">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="YValue" FieldName="ValorA">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                </Telerik_Windows_Controls_Charting:SeriesMapping>    
                  
                <Telerik_Windows_Controls_Charting:SeriesMapping x:Name="Serie2" LegendLabel="ValorB">    
                    <Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                        <Telerik_Windows_Controls_Charting:StackedBarSeriesDefinition ShowItemLabels="False" ShowItemToolTips="True" StackGroupName="2009"  />    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                      
                    <Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="XValue" FieldName="Mes">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="YValue" FieldName="ValorB">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                </Telerik_Windows_Controls_Charting:SeriesMapping> 
                  
                <Telerik_Windows_Controls_Charting:SeriesMapping x:Name="Serie3" LegendLabel="ValorC">    
                    <Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                        <Telerik_Windows_Controls_Charting:StackedBarSeriesDefinition ShowItemLabels="False" ShowItemToolTips="True" StackGroupName="2009"  />    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                      
                    <Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="XValue" FieldName="Mes">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="YValue" FieldName="ValorC">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                </Telerik_Windows_Controls_Charting:SeriesMapping> 
                  
                <Telerik_Windows_Controls_Charting:SeriesMapping x:Name="Serie4" LegendLabel="ValorD">    
                    <Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                        <Telerik_Windows_Controls_Charting:StackedBarSeriesDefinition ShowItemLabels="False" ShowItemToolTips="True" StackGroupName="2009"  />    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                      
                    <Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="XValue" FieldName="Mes">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="YValue" FieldName="ValorD">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                </Telerik_Windows_Controls_Charting:SeriesMapping> 
                  
                <Telerik_Windows_Controls_Charting:SeriesMapping x:Name="Serie5" LegendLabel="ValorA1">    
                    <Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                        <Telerik_Windows_Controls_Charting:StackedBarSeriesDefinition ShowItemLabels="False" ShowItemToolTips="True" StackGroupName="2010"  />    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                      
                    <Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="XValue" FieldName="Mes"  > 
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="YValue" FieldName="ValorA1">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                </Telerik_Windows_Controls_Charting:SeriesMapping> 
                  
                <Telerik_Windows_Controls_Charting:SeriesMapping x:Name="Serie6" LegendLabel="ValorB1">    
                    <Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                        <Telerik_Windows_Controls_Charting:StackedBarSeriesDefinition ShowItemLabels="False" ShowItemToolTips="True" StackGroupName="2010"  />    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                      
                    <Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="XValue" FieldName="Mes">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="YValue" FieldName="ValorB1">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                </Telerik_Windows_Controls_Charting:SeriesMapping> 
                  
                <Telerik_Windows_Controls_Charting:SeriesMapping x:Name="Serie7" LegendLabel="ValorC1">    
                    <Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                        <Telerik_Windows_Controls_Charting:StackedBarSeriesDefinition ShowItemLabels="False" ShowItemToolTips="True" StackGroupName="2010"  />    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                      
                    <Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="XValue" FieldName="Mes">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="YValue" FieldName="ValorC1">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                </Telerik_Windows_Controls_Charting:SeriesMapping> 
                  
                <Telerik_Windows_Controls_Charting:SeriesMapping x:Name="Serie8" LegendLabel="ValorD1">    
                    <Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                        <Telerik_Windows_Controls_Charting:StackedBarSeriesDefinition ShowItemLabels="False" ShowItemToolTips="True" StackGroupName="2010"  />    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                      
                    <Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="XValue" FieldName="Mes">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="YValue" FieldName="ValorD1">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                </Telerik_Windows_Controls_Charting:SeriesMapping> 
                  
                <Telerik_Windows_Controls_Charting:SeriesMapping x:Name="Serie9" LegendLabel="Tot">    
                    <Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                        <Telerik_Windows_Controls_Charting:LineSeriesDefinition ShowItemLabels="True" ShowItemToolTips="True"/>    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.SeriesDefinition>    
                      
                    <Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="XValue" FieldName="Mes">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                        <Telerik_Windows_Controls_Charting:ItemMapping DataPointMember="YValue" FieldName="Tot">  
                        </Telerik_Windows_Controls_Charting:ItemMapping>    
                    </Telerik_Windows_Controls_Charting:SeriesMapping.ItemMappings>    
                </Telerik_Windows_Controls_Charting:SeriesMapping> 
                                      
            </Telerik_Windows_Controls:RadChart.SeriesMappings>                           
                          
        </Telerik_Windows_Controls:RadChart> 

C#

public class Values  
    {  
        public double Mes { getset; }  
        public double ValorA { getset; }  
        public double ValorB { getset; }  
        public double ValorC { getset; }  
        public double ValorD { getset; }  
        public double ValorA1 { getset; }  
        public double ValorB1 { getset; }  
        public double ValorC1 { getset; }  
        public double ValorD1 { getset; }  
        public double Tot { getset; }  
 
        public Values(double mes, double valora, double valorb, double valorc, double valord, double valora1,  
            double valorb1, double valorc1, double valord1, double tot)  
        {  
            this.Mes = mes;  
            this.ValorA = valora;  
            this.ValorB = valorb;  
            this.ValorC = valorc;  
            this.ValorD = valord;  
            this.ValorA1 = valora1;  
            this.ValorB1 = valorb1;  
            this.ValorC1 = valorc1;  
            this.ValorD1 = valord1;  
            this.Tot = tot;  
        }  
    }  
 
 
chart.ItemsSource = new List<Values>()   
                {  
    
                new Values(1, 5,10,15,20,25,30,35,40,150),  
                new Values(2, 10,15,20,25,30,35,40,45,155),  
                new Values(3, 15,20,25,30,35,40,45,50,160),  
                new Values(4, 20,25,30,35,40,45,50,55,165),  
                new Values(5, 25,30,35,40,45,50,55,60,170),  
                new Values(6, 30,35,40,45,50,55,60,65,175),  
                new Values(7, 35,40,45,50,55,60,65,70,180),  
                new Values(8, 40,45,50,55,60,65,70,75,185),  
                new Values(9, 45,50,55,60,65,70,75,80,190),  
                new Values(10, 50,55,60,65,70,75,80,85,195),  
                new Values(11, 55,60,65,70,75,80,85,90,200),  
                new Values(12, 60,65,70,75,80,85,90,95,205)  
}; 

Thanks...

2 Answers, 1 is accepted

Sort by
0
Natália
Top achievements
Rank 1
answered on 05 Jul 2010, 07:04 PM
In the example above the chart repeats the month of January for almost all points ...

Why does this happen?


Thanks...
0
Vladimir Milev
Telerik team
answered on 08 Jul 2010, 09:56 AM
Hi Natália,

Perhaps the displayed date time range on the X Axis is entirely inside January? I can't really give you a more detailed explanation without running your project.

All the best,
Vladimir Milev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Natália
Top achievements
Rank 1
Answers by
Natália
Top achievements
Rank 1
Vladimir Milev
Telerik team
Share this question
or