How to increase distance between values in x axis

3 posts, 0 answers
  1. FMorales
    FMorales avatar
    26 posts
    Member since:
    Aug 2014

    Posted 25 Nov 2014 Link to this post


    I have created a simple bar chart but I would like to increase the distance between the values on x-axis and get the bars a little bit more longer.

    There is a simple ways to do it?

    here I attach my simple chart.

    Thanks a lot
  2. FMorales
    FMorales avatar
    26 posts
    Member since:
    Aug 2014

    Posted 26 Nov 2014 in reply to FMorales Link to this post

    Hi again, 

    simply I would like to add more space between labels.

    Could I make bigger the space between labels??

  3. DevCraft R3 2016 release webinar banner
  4. Dess
    Dess avatar
    1561 posts

    Posted 28 Nov 2014 Link to this post

    Hello Farncisco,

    Thank you for writing.

    You can control at what distance the labels will be rendered on the LinearAxis, by setting the MajorStep property:
    public Form1()
        BarSeries barSeries = new BarSeries("Performance", "RepresentativeName");
        barSeries.Name = "Q1";
        barSeries.DataPoints.Add(new CategoricalDataPoint(177, "Harley"));
        barSeries.DataPoints.Add(new CategoricalDataPoint(128, "White"));
        barSeries.DataPoints.Add(new CategoricalDataPoint(143, "Smith"));
        barSeries.DataPoints.Add(new CategoricalDataPoint(111, "Jones"));
        barSeries.DataPoints.Add(new CategoricalDataPoint(118, "Marshall"));
        BarSeries barSeries2 = new BarSeries("Performance", "RepresentativeName");
        barSeries2.Name = "Q2";
        barSeries2.DataPoints.Add(new CategoricalDataPoint(153, "Harley"));
        barSeries2.DataPoints.Add(new CategoricalDataPoint(141, "White"));
        barSeries2.DataPoints.Add(new CategoricalDataPoint(130, "Smith"));
        barSeries2.DataPoints.Add(new CategoricalDataPoint(88, "Jones"));
        barSeries2.DataPoints.Add(new CategoricalDataPoint(109, "Marshall"));
        CartesianGrid grid = this.radChartView1.GetArea<CartesianArea>().GetGrid<CartesianGrid>();
        this.radChartView1.GetArea<CartesianArea>().Orientation = Orientation.Horizontal;
        grid.DrawVerticalStripes = true;
        grid.DrawHorizontalStripes = false;
        LinearAxis verticalAxis = barSeries.HorizontalAxis as LinearAxis;
        if (verticalAxis != null)
            verticalAxis.MajorStep = 10;
            verticalAxis.LabelFitMode = AxisLabelFitMode.Rotate;

    I hope this information helps. Should you have further questions, I would be glad to help.

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top