This question is locked. New answers and comments are not allowed.
Hello Telerik!
I have following xaml code:
and c# code:
My problem is the next: how I can display zero value label when I use BarSeriesDefinition?
I tried to use property
Could You help me please resolve my problem: display label for item with "0" value?
Please help me,
Volodya.
I have following xaml code:
<UserControl x:Class="SilverlightApplication8.CategoryBarZoom" mc:Ignorable="d" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <telerik:RadChart x:Name="RadChart1"></telerik:RadChart> </Grid></UserControl>and c# code:
using System.Collections.Generic;using System.Windows;using System.Windows.Controls;using Telerik.Windows.Controls;using Telerik.Windows.Controls.Charting;namespace SilverlightApplication8{ public partial class CategoryBarZoom { public CategoryBarZoom() { InitializeComponent(); this.Loaded += new RoutedEventHandler(CategoryBarZoom_Loaded); } void CategoryBarZoom_Loaded(object sender, RoutedEventArgs e) { RadChart1.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollAndZoom; this.SetMappings(RadChart1); RadChart1.ItemsSource = new List<MyData>() { new MyData("Name1", 0), new MyData("Name2", 15), new MyData("Name3", 0), new MyData("Name4", 0), new MyData("Name5", 5), new MyData("Name6", 35), new MyData("Name7", 5), new MyData("Name8", 25), new MyData("Name9", 5), new MyData("Name10", 25), new MyData("Name11", 5) }; } private void SetMappings(RadChart chart) { SeriesMapping seriesMapping = new SeriesMapping(); seriesMapping.SeriesDefinition = new BarSeriesDefinition(); (seriesMapping.SeriesDefinition as BarSeriesDefinition).LabelSettings.ShowZeroValueLabels = true; ItemMapping itemMapping = new ItemMapping(); itemMapping.DataPointMember = DataPointMember.YValue; itemMapping.FieldName = "Value"; seriesMapping.ItemMappings.Add(itemMapping); itemMapping = new ItemMapping(); itemMapping.DataPointMember = DataPointMember.XCategory; itemMapping.FieldName = "Name"; seriesMapping.ItemMappings.Add(itemMapping); chart.SeriesMappings.Add(seriesMapping); } } public class MyData { public double Value { get; set; } public string Name { get; set; } public MyData(string name, double value) { this.Name = name; this.Value = value; } }}My problem is the next: how I can display zero value label when I use BarSeriesDefinition?
I tried to use property
ShowZeroValueLabels for BarSeriesDefinition, but this didn't resolved my problem. ShowZeroValueLabels property works fine for HorizontalBarSeriesDefinition, but for BarSeriesDefinition I can't display label for item when it has zero value.Could You help me please resolve my problem: display label for item with "0" value?
Please help me,
Volodya.