BarSeries on DateTimeContinousAxys

4 posts, 0 answers
  1. Marcello
    Marcello avatar
    58 posts
    Member since:
    Apr 2013

    Posted 11 Jun 2013 Link to this post

    Hi,

    Is possible to set manually the columns width?
    Look this example, all columns is overlappeds!

    <telerik:RadCartesianChart>
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:DateTimeContinuousAxis MaximumTicks="5" PlotMode="OnTicksPadded"/>
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis/>
                </telerik:RadCartesianChart.VerticalAxis>
                <telerik:BarSeries Name="mS">
     
                </telerik:BarSeries>
                <telerik:RadCartesianChart.Behaviors>
                    
                    <telerik:ChartPanAndZoomBehavior/>
                </telerik:RadCartesianChart.Behaviors>
            </telerik:RadCartesianChart>
    public MainWindow()
            {
                InitializeComponent();
     
                for (int i = 0; i < 100;i++ )
                    mS.DataPoints.Add(new Telerik.Charting.CategoricalDataPoint() { Category = System.DateTime.Today.AddDays(i), Value = 5 });
                 
            }
  2. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 13 Jun 2013 Link to this post

    Hi Marcello,

    The width of the BarSeries items, depends on the size of the step between axis ticks. You can use the MajorStepUnit and MajorStep properties to adjust it. Here is an example: 
    <telerik:RadCartesianChart Palette="Windows8">
        <telerik:RadCartesianChart.HorizontalAxis>
            <telerik:DateTimeContinuousAxis MaximumTicks="5"
                                  PlotMode="OnTicksPadded"
                                  MajorStepUnit="Day"
                                  MajorStep="1"
                                  LabelInterval="10"
                                  LabelFitMode="Rotate"
                                  LabelRotationAngle="-90"/>
        </telerik:RadCartesianChart.HorizontalAxis>
     
        <telerik:RadCartesianChart.VerticalAxis>
            <telerik:LinearAxis/>
        </telerik:RadCartesianChart.VerticalAxis>
     
        <telerik:BarSeries Name="mS" PaletteMode="DataPoint"/>
     
        <telerik:RadCartesianChart.Behaviors>
            <telerik:ChartPanAndZoomBehavior/>
        </telerik:RadCartesianChart.Behaviors>
    </telerik:RadCartesianChart>

    I have attached a screenshot for reference.

    I hope this was the solution you were looking for.
     
    Regards,
    Petar Kirov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Marcello
    Marcello avatar
    58 posts
    Member since:
    Apr 2013

    Posted 08 Jul 2013 Link to this post

    Hi kirov,

    Ok, so for Bar Column usage is mandatory to set manually the Axis Plot Properties.
    But this create a lot of problems.
    Please look my other post in http://www.telerik.com/community/forums/wpf/chart/datetimecontinuousaxis-ticks.aspx#2695711

    Thank's
    marc.
  5. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 11 Jul 2013 Link to this post

    Hi Marc,

    I have attached a project that shows another approach - BarSeries with PointTemplate with data-bound Width property. This allows you modify the bar width directly when needed (eg. when the ZoomChanged event occurs). Additionally, you may find useful the RadCartesianChart.PlotAreaClip.Width property, which you can use to get the available plot area space.

    I hope this helps.
     
    Regards,
    Petar Kirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    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 >>
Back to Top