Chart for WinRT > Chart Features > Interaction > Zooming |
To scale the Bubble chart while zooming, adjust the scale in the DataSeries.PlotElementLoaded event like the following:
C# |
Copy Code
|
---|---|
var ds = new BubbleSeries() { XValuesSource = new double[] { 1, 2, 3, 4 }, ValuesSource = new double[] { 1, 2, 3, 4 }, SizeValuesSource = new double[] { 1, 2, 3, 4 }, }; //Adjust scaling in the PlotElementLoaded event ds.PlotElementLoaded += (s, e) => { var pe = (PlotElement)s; pe.RenderTransform = new ScaleTransform() { ScaleX = 1.0 / c1Chart1.View.AxisX.Scale, ScaleY = 1.0 / c1Chart1.View.AxisY.Scale }; pe.RenderTransformOrigin = new Point(0.5, 0.5); }; c1Chart1.Data.Children.Add(ds); c1Chart1.ChartType = ChartType.Bubble; c1Chart1.Actions.Add(new TranslateAction()); c1Chart1.Actions.Add(new ScaleAction() { Modifiers = ModifierKeys.Control }); |