Hi All,
1. I have an issue where the chart x-axis label is off the screen. The X-Axis is coming dynamically from database
-Screenshot Attached
-Code
-Xaml of AxisLabel Style
2.How do you put an offset to the beginning of the chart - Image attached
Any help will be appreciated
Cheers
1. I have an issue where the chart x-axis label is off the screen. The X-Axis is coming dynamically from database
-Screenshot Attached
-Code
RebindChartReport(radChartReport);
radChartReport.ItemsSource = e.Result;
radChartReport.DefaultView.ChartArea.SmartLabelsEnabled =
true
;
radChartReport.DefaultView.ChartArea.AxisX.AxisStyles.ItemLabelStyle =
this
.Resources[
"AxisLabelStyle"
]
as
Style;
private
void
RebindChartReport(RadChart radChart,
bool
isBar =
false
)
{
radChart.SeriesMappings.Clear();
SeriesMapping seriesMapping =
new
SeriesMapping();
if
(isBar)
{ seriesMapping.SeriesDefinition =
new
BarSeriesDefinition(); }
else
{
seriesMapping.SeriesDefinition =
new
LineSeriesDefinition();
}
seriesMapping.GroupingSettings.GroupDescriptors.Add(
new
ChartGroupDescriptor(
"YAxisLegendName"
));
seriesMapping.ItemMappings.Add(
new
ItemMapping(
"XYValue"
, DataPointMember.YValue));
seriesMapping.ItemMappings.Add(
new
ItemMapping(
"XAxisName"
, DataPointMember.XCategory));
radChart.SeriesMappings.Add(seriesMapping);
radChart.DefaultView.ChartArea.AxisX.AutoRange =
true
;
}
-Xaml of AxisLabel Style
<
Style
x:Key
=
"AxisLabelStyle"
TargetType
=
"TextBlock"
>
<
Setter
Property
=
"TextWrapping"
Value
=
"Wrap"
/>
<
Setter
Property
=
"Width"
Value
=
"100"
/>
<
Setter
Property
=
"Padding"
Value
=
"10"
/>
<
Setter
Property
=
"Margin"
Value
=
"10"
/>
<
Setter
Property
=
"FontSize"
Value
=
"11"
/>
<
Setter
Property
=
"TextAlignment"
Value
=
"Center"
/>
</
Style
>
2.How do you put an offset to the beginning of the chart - Image attached
Any help will be appreciated
Cheers