Hi,
I was drawing charts on a RadMap like in your City demographics example. That was working fine until I've upgraded to the latest Q3 version. Now I have an issue when zooming: the small charts are enlarged when zooming in and when the zoom is finished they are resized again. This was not like this with the version before, when the radcharts had a constant size.
Here is my code:
And the XAML:
Is it possible to achieve the original behavior?
Many thanks and best regards,
Tamas
I was drawing charts on a RadMap like in your City demographics example. That was working fine until I've upgraded to the latest Q3 version. Now I have an issue when zooming: the small charts are enlarged when zooming in and when the zoom is finished they are resized again. This was not like this with the version before, when the radcharts had a constant size.
Here is my code:
private
void
InitializeChart(RadChart chart, List<LabeledCell> cells, Telerik.Windows.Controls.Map.Location location)
{
this
.SetChartDimension(chart);
chart.BorderThickness =
new
Thickness(0);
chart.DefaultView.ChartArea.Background =
new
SolidColorBrush(Colors.Transparent);
chart.DefaultView.ChartArea.Padding =
new
Thickness(0);
chart.Background =
new
SolidColorBrush(Colors.Transparent);
chart.DefaultView.ChartLegend.Visibility = Visibility.Collapsed;
chart.DefaultView.ChartTitle.Visibility = Visibility.Collapsed;
chart.DefaultSeriesDefinition =
new
PieSeriesDefinition() { ShowItemLabels =
false
};
chart.Margin =
new
Thickness(-1 * (chart.Width / 2), -1 * (chart.Height / 2), 0, 0);
List<
double
> chartdata =
new
List<
double
>();
foreach
(LabeledCell cell
in
cells)
{
chartdata.Add(Double.Parse(cell.Value.ToString()));
}
chart.ItemsSource = chartdata;
chart.SetValue(MapLayer.LocationProperty, location);
this
.InformationLayer.Items.Add(chart);
}
private
void
SetChartDimension(RadChart chart)
{
if
(
this
.RadMap1.ZoomLevel < 0)
return
;
chart.Height = 30 *
this
.RadMap1.ZoomLevel;
chart.Width = 30 *
this
.RadMap1.ZoomLevel;
}
And the XAML:
<
telerik:RadMap
x:Name
=
"RadMap1"
ZoomLevel
=
"2"
>
<
telerik:InformationLayer
x:Name
=
"InformationLayer"
Visibility
=
"Visible"
>
<
telerik:InformationLayer.MapControl
>
<
telerik:RadMap
Background
=
"Transparent"
Foreground
=
"Transparent"
/>
</
telerik:InformationLayer.MapControl
>
</
telerik:InformationLayer
>
</
telerik:RadMap
>
Is it possible to achieve the original behavior?
Many thanks and best regards,
Tamas