This is a migrated thread and some comments may be shown as answers.

BarSeries on DateTimeContinousAxys

3 Answers 38 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Marcello
Top achievements
Rank 1
Marcello asked on 11 Jun 2013, 10:34 AM
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 });
             
        }

3 Answers, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 13 Jun 2013, 02:29 PM
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.

0
Marcello
Top achievements
Rank 1
answered on 08 Jul 2013, 11:15 AM
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.
0
Petar Kirov
Telerik team
answered on 11 Jul 2013, 11:36 AM
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 >>
Tags
Chart
Asked by
Marcello
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Marcello
Top achievements
Rank 1
Share this question
or