This question is locked. New answers and comments are not allowed.
Hello,
I am using RadLegendControl to show Legend for my RadCartisianChart. I can see the Legend but it is not showing any Text with the Legend. Here is the XAML code and CS code:
I am using RadLegendControl to show Legend for my RadCartisianChart. I can see the Legend but it is not showing any Text with the Legend. Here is the XAML code and CS code:
<telerikPrimitives:RadLegendControl x:Name="Legend" LegendProvider="{Binding ElementName=bar}"> </telerikPrimitives:RadLegendControl><telerik:RadCartesianChart x:Name="bar" PaletteName="DefaultDark" HorizontalAlignment="Stretch" Background="Brown" Padding="0,0,-50,0" VerticalAlignment="Stretch"> <telerik:RadCartesianChart.HorizontalAxis> <telerik:CategoricalAxis/> </telerik:RadCartesianChart.HorizontalAxis> <telerik:RadCartesianChart.VerticalAxis> <telerik:LinearAxis/> </telerik:RadCartesianChart.VerticalAxis> <telerik:RadCartesianChart.Grid> <telerik:CartesianChartGrid MajorLinesVisibility="Y" StripLinesVisibility="Y"/> </telerik:RadCartesianChart.Grid> <telerik:RadCartesianChart.Behaviors> <telerik:ChartTooltipBehavior/> </telerik:RadCartesianChart.Behaviors> <telerik:BarSeries x:Name="worldwide" CombineMode="Cluster" ItemsSource="{Binding Data1}" ValueBinding="{StaticResource ValueBinding}" ShowLabels="True" CategoryBinding="{StaticResource CategoryBinding}"> </telerik:BarSeries> <telerik:BarSeries CombineMode="Cluster" ItemsSource="{Binding Data2}" ValueBinding="{StaticResource ValueBinding}" ShowLabels="True" CategoryBinding="{StaticResource CategoryBinding}"/> </telerik:RadCartesianChart>
CS Code:
public class Data
{
public string Category { get; set; }
public int Value { get; set; }
}
public class SampleViewModel
{
public IEnumerable Data1 { get; private set; }
public IEnumerable Data2 { get; private set; }
public SampleViewModel(List<Data> list1, List<Data> list2)
{
this.Data1 = list1.ToList();
this.Data2 = list2.ToList();
}
}
List<Data> w2000, u2000;
w2000 = new List<Data>();
w2000.Add(new Data() { Category = "ABC", Value = 3120 });
u2000 = new List<Data>();
u2000.Add(new Data() { Category = "XYZ", Value = 320 });
this.DataContext = new SampleViewModel(w2000, u2000);