XAxis Label inside the bar

Thread is closed for posting
2 posts, 0 answers
  1. Tobin
    Tobin avatar
    9 posts
    Member since:
    Oct 2007

    Posted 15 Oct 2008 Link to this post

    Hi Telerik.

    1. How do i put XAxis label (O in styling chart element) inside the bar (P in styling chart element) instead in bottom ? I have difficulty since my XAxis data is long.

    2. How do i format Series Item Label (r in styling chart element) to number with decimal?

    3. My bar chart bound to empty dataset, how to make sure that the chart will show EmptyChartMessage, since my case it didnt show.

    Thank for your help.
  2. Dwight
    Dwight avatar
    475 posts

    Posted 17 Oct 2008 Link to this post

    Hello Tobin,

    It is not possible to move the Axis Labels inside a bar nor any other chart as those labels are designed to display information on the Axes. If you prefer, you can hide them by setting

    this.radChart1.PlotArea.XAxis.Appearance.LabelAppearance.Visible = false;

    You can customize the items' labels by handling the Chart's ItemDataBound event:
    public partial class Form1 : Form 
        double[] sampleData = new double[] { 0, 10, 20, 30, 40, 5, 20, 35, 50, 65 }; 
        public Form1() 
            this.radChart1.PlotArea.XAxis.Appearance.LabelAppearance.Visible = false
            this.radChart1.ItemDataBound += new EventHandler<ChartItemDataBoundEventArgs>(radChart1_ItemDataBound); 
            this.radChart1.DataSource = sampleData; 
        void radChart1_ItemDataBound(object sender, ChartItemDataBoundEventArgs e) 
            e.SeriesItem.Label.TextBlock.Text = "New Label"
            e.SeriesItem.Label.Appearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Inside; 

    The EmptyChartMessage shows up only in case there are no series in the RadChart.Series collection (and none are generated by the binding). Having no ChartSeriesItems in the series does not count as empty chart.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top