4 Answers, 1 is accepted
Please check out the Displaying Incremental DateTime Values in the X-Axis of RadChart blog that elaborates on using date values for the XAxis.
Best wishes,Peter
the Telerik team
We're not sure how setting the skin causes the problem since we have a runnable example of this functionality with Skin applied, see it here. Can you confirm that the problem occurs when setting skin to the project from the blog post?
Kind regards,
Steve
the Telerik team
There is a problem that setting the 'Skin' Property of a chart in the report designer obliterates many of the chart PlotArea properties. I have had problems with the following, for example:
- Appearance.Dimensions.Margins
- XAxis.Appearance.ValueFormat
- XAxis.Appearance.CustomFormat
- XAxis.Appearance.LabelAppearance.RotationAngle
- XAxis.Appearance.LabelAppearance.Position.AlignedPosition
On setting the chart's Skin property in the designer, these properties (and others no doubt) all revert to default values.
Furthermore, you can't use the designer to set these properties back once you have set a Skin property. You can try, and they look OK in the designer, but so long as the 'Skin' property is not null, they are ignored at runtime.
This has come up at least a couple of times in these forums and has been acknowledged by Telerik as a bug. but no fix yet. As they suggested, the only recourse is to set the desired properties programatically in the constructor of your report. In my case, it looked something like the following:
public
MyReport()
{
//
// Required for telerik Reporting designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
// We need to set these graphical properties here, as the presence of a Skin cause them to be overwritten:
this
.myChart.PlotArea.XAxis.Appearance.ValueFormat = ChartValueFormat.ShortDate;
this
.myChart.PlotArea.XAxis.Appearance.CustomFormat =
"dd-MMM"
;
this
.myChart.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 270;
this
.myChart.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = AlignedPositions.Top;
// Sizing of chart area
this
.myChart.PlotArea.Appearance.Dimensions.Margins =
"14%, 4%, 15%, 10%"
;
}
I'm running version 5.0.11.510 (Telerik Reporting Q1 2011 SP1). Hopefully a fix will come soon.
Regards,
Mike