How to format the x-axis label in ChartView(latest)

6 posts, 0 answers
  1. Haidong
    Haidong avatar
    6 posts
    Member since:
    Sep 2011

    Posted 28 Mar 2012 Link to this post

    I am using ChartView, and I am not able to format my double value in x-axis in percent format, for example, the value is 0.005 and I want to display it as 0.5% in my x-axis. below is my code

    <chart:ChartDataSource x:Name="DataSource" ItemsSource="{Binding Data}" SamplingUnit="NONE" />
    <chart:RadCartesianChart Palette="Metro" Grid.Row="1" ClipToBounds="False" >
        <chartView:BarSeries ItemsSource="{Binding ElementName="DataSource"} CategoryBinding="Value" ValueBinding="Count" ShowLabels="True" />
                <chartView:CategoricalAxis MajorTickInterval="1" LabelInterval="1" LabelFormat="P" PlotMode="OnTicksPadded"/>
                    <chartView:LinearAxis />

    As you can see from above code, I try to use LabelFormat="P" to formate x-axis as I did in old telerik Chart but it doesn't work
  2. Nikolay
    Nikolay avatar
    395 posts

    Posted 02 Apr 2012 Link to this post


    Unfortunately for the time being the CategoricalAxis does not support formatting of the label, as the most common usage would be binding strings as a category and not numeric values. Our develoeprs are aware of this and will consider adding this ability for future versions of the control. In the meantime we would suggest that you bind strings, instead of doubles, to CategoryBinding in order to achieve the desired behavior.

    All the best,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. Senthil kumar
    Senthil kumar avatar
    21 posts
    Member since:
    Sep 2013

    Posted 19 Nov 2013 Link to this post


    I have a RadCartesianChart using a line axis and CategoricalAxis as HorizontalAxis. i want to represent the category axis whole integer format : 0 2 4 6 8.....

    my code is 
     CategoricalAxis categoricalAxis = new CategoricalAxis();
                                categoricalAxis.LabelFitMode = AxisLabelFitMode.MultiLine;
                                categoricalAxis.MajorTickInterval = 4;
                                categoricalAxis.MajorTickOffset =1; 
                                categoricalAxis.LabelInterval =4;
                                categoricalAxis.LabelOffset = 0;
                                categoricalAxis.LabelFormat = "#0";
                                categoricalAxis.LastLabelVisibility = AxisLastLabelVisibility.Visible;
                                chart.HorizontalAxis = categoricalAxis;

    but, the chart is not produce the result as expected. it produce the result with decimal format (as it is plot value) image attached.

    could you please suggest the solution.
  4. Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 21 Nov 2013 Link to this post

    Hello Senthil,

    I see that you have already asked the same question in a different thread here. I will ask that you avoid duplicating the same questions because it makes it really hard to help and guide you and follow the communication.

    Petar Marchev
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. ben
    ben avatar
    5 posts
    Member since:
    Jul 2007

    Posted 01 Jul 2015 in reply to Nikolay Link to this post

    Is there an update to this issue, or link to status?  Has this been addressed in a later Telerik release?



  6. Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 03 Jul 2015 Link to this post

    Hi Ben,

    As mentioned earlier, this is a duplicate question and it was discussed in a different thread. You can go through the other thread to find information. If you do not find what you are looking for you can open a new forum thread to ask your question.

    Petar Marchev
    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 Feedback Portal and vote to affect the priority of the items
Back to Top