x Category not showing as required

2 posts, 0 answers
  1. Ramakrishna
    Ramakrishna avatar
    16 posts
    Member since:
    Jan 2011

    Posted 24 Feb 2012 Link to this post

    I attached 2 images with this post
    Currentgraph:  it is the my current rendering chart using telerik chart.
    Imagegraph: it is the expected graph

    actually right now i am getting the graph what i need but in x axis i need to show only month names like January February.
    below is the sample data  i have

    Date Month Hour Aggregate
    1/1/2010 January 0 408
    1/1/2010 January 1 405
    1/1/2010 January 2 399
    1/2/2010 February
    1/2/2010 February 1
    1/2/2010 February 2
    1/3/2010 March 0
    1/3/2010 March 1
    1/3/2010 March 2

    i want to show Aggregate in y axis
    Month in X- axis.(month should be show like category type like all January values should be group it means for each aggregate value i dont need to show January January January January like instead of only one January is enough for all values)

    right now i did like that only but my graph look like in currentgraph.png file(problem here is in x- axis it is giving numbers why it is giving like that  i dont know because i didn't tell to that give me like that apart from that every thing is coming good)

    below i am pasting my current code feel free to change the code to meet my requirement in imagegraph.png(no need to show Hour and Date is X-axis i written because to show i dont want to group Aggregate value by month name)

    <telerik:RadChart x:Name="RCAD" PaletteBrushesUseSolidColors="True">
                                    <telerik:ChartTitle Content="Annual Demand" HorizontalAlignment="Stretch"/>
                                    <telerik:ChartArea NoDataString="Loading please wait" LegendName="RCADLegend">
                                            <telerik:AnimationSettings ItemAnimationDuration="00:00:03">
                                            <telerik:AxisX AutoRange="True" LayoutMode="Inside" Title="Month" LabelRotationAngle="270"></telerik:AxisX>
                                            <telerik:AxisY Title="Demand(KWH)" AutoRange="True"></telerik:AxisY>
                                    <telerik:SplineSeriesDefinition ShowItemLabels="False" ShowItemToolTips="True" ShowPointMarks="False">
                                                    <telerik:PointMarkAppearanceSettings Shape="Circle">
                                    <telerik:ItemMapping DataPointMember="YValue" FieldName="Aggregate"></telerik:ItemMapping>
                                    <telerik:ItemMapping DataPointMember="XValue" FieldName="Month1"></telerik:ItemMapping>

    Please give me response, it is urgent requirement for my project

    Thank you in advance
  2. Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 28 Feb 2012 Link to this post


    1. If you want to have the axis Y title rotated you can use the AxisY.AxisStyles. But keep in mind that the axis Y title was never intended to be rotated so you might have some difficulties setting it to look as you want (if difficulties arise you can consider placing a text block manually instead). This code will get you started with the axis styles:
        <Style TargetType="telerik:AxisTitle" >
         <Setter Property="Height" Value="80" />
          <Setter Property="RenderTransform">
            <RotateTransform Angle="90" />
    3. Month in X- axis.
    Unfortunately there is no way to achieve what you have described and depicted in the attached images. The X axis has major and minor ticks and some of the major ticks have labels. Thus there is no way to achieve such a complex layout.

    4. In the CurrentGraph image the axis labels are clustered really close together. You can read this help topic to get some ideas how you can have less labels, so that the text in the labels is readable. You can set some TicksDistance, rotation angle and default label format to accomplish this task.

    All the best,
    Petar Marchev
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top