This question is locked. New answers and comments are not allowed.
I have to display a couple of charts in both left to right (LTR) and right to left (RTL) orientations, depending on the CurrentUICulture. It seems the chart doesn't support this.
My current solution is to use code to move around the elements on the chart based on the culture. Here's the code I'm using:
This solves some of the display issues, but I couldn't find any easy way to cause the charts to appear in the "top left" quadrant so the values on the x-axis "increase" from right to left. The alignments should automatically "reverse" direction in RTL mode.
Actually, I think there should be a property to specify whether a chart should stick to mathematical quadrants for the plot area, or to standard control alignment and direction. Not all charts show pure mathematical data.
Is there any way currently to get the chart to reverse the x-axis direction?
Thanks for any assistance!
My current solution is to use code to move around the elements on the chart based on the culture. Here's the code I'm using:
private void LocalizeChart(RadChart chart) | |
{ | |
bool isRtl = RightToLeft == RightToLeft.Yes; | |
chart.Legend.Appearance.Position.AlignedPosition = isRtl ? AlignedPositions.Right : AlignedPositions.Left; | |
chart.PlotArea.YAxis.Visible = isRtl ? ChartAxisVisibility.True : ChartAxisVisibility.False; | |
chart.PlotArea.YAxis2.Visible = isRtl ? ChartAxisVisibility.False : ChartAxisVisibility.True; | |
chart.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = CHART_X_AXIS_TEXT_ANGLE * (isRtl ? 1 : -1); | |
} | |
This solves some of the display issues, but I couldn't find any easy way to cause the charts to appear in the "top left" quadrant so the values on the x-axis "increase" from right to left. The alignments should automatically "reverse" direction in RTL mode.
Actually, I think there should be a property to specify whether a chart should stick to mathematical quadrants for the plot area, or to standard control alignment and direction. Not all charts show pure mathematical data.
Is there any way currently to get the chart to reverse the x-axis direction?
Thanks for any assistance!