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

Chart X Axis Labels

3 Answers 69 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Willem
Top achievements
Rank 1
Willem asked on 29 Jul 2013, 05:36 AM
Please see the attached screenshot of a chart. Using CartesianChart, RangeBarSeries and DateTimeCategoricalAxis

Ideally we would like to be able to display x axis labels under the ticks as shown in the attached screenshot however we want the series to display between ticks (shifted to the left) and without the padding.  The combinations we have tried are as follows :

- Use PlotMode = OnTicksPadded (Labels are fine but series are on the line and padding on either side is undesirable)
- Use PlotMode = OnTicks (Labels are right and padding is gone but series on the far right is truncated)
- Use PlotMode = OnTicks and add half a grid width to the bar series (labels look right, no padding and series look right but tool tips are still over the original series position)
- Use PlotMode = BetweenTicks (Series look right but labels are in the center)
- Use PlotMode = BetweenTicks and shift labels to the right by half a grid width (Labels, series and tooltips correct but missing the first date point (i.e. really need to add another date to the axis)

None of the above give the desired functionalty, could you please advise how to achieve this.

Regards

Willem

3 Answers, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 31 Jul 2013, 06:08 PM
Hi Willem,

RadCartesianChart does not support this scenario. However if you really want implement it, you can use the following workaround:
  • RadCartesianChart.ClipToBounds = false (to prevent the clipping of the first label)
  • The default horizontal is with PlotMode set to OnTicks
  • Each series uses a different horizontal axis with PlotMode set to BetweenTicks. This axis is collapsed.
  • An additional placeholder series is added which works with the default axis (because if no series is associated with an axis, the axis doesn't display anything). The placeholder series is hidden by specifying an empty PointTemplate.

I have attached a sample project demonstrating this.
 
Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
0
Willem
Top achievements
Rank 1
answered on 01 Aug 2013, 12:09 AM
Hi Petar,

Thanks for your response. 

The proposed solution and sample project are not quite there however as you can see the series are offset by a small amount for each tick (i.e. the green series looks right in the first gridlines but then slowly crosses the gridlines in subsequent ticks). 

Most likely because the visible axis and the invisible axes do not exactly align.

Any other ideas?

Regards

Willem
0
Accepted
Petar Kirov
Telerik team
answered on 02 Aug 2013, 04:13 PM
Hi Willem,

This is because the two axes have different number of ticks (the axis with PlotMode = OnTicks has one less tick then the one with BetweenTicks). The workaround for this is to add one additional item to the invisible series. I have attached a modified version of the project that shows this. Probably you will need to further adjust the converter for your scenario. 

Actually I had included this solution the first time but then I went back and forth on a couple of things in order to streamline the solution I forgot to include it in the final project, so please excuse me for the omission.
 
Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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
ChartView
Asked by
Willem
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Willem
Top achievements
Rank 1
Share this question
or