change size and position of a rectangle in the graph

Mar 15, 2011 at 8:50 PM

I have a problem
I put in my chart with a rectangle with the command RectangleHiglight:

<d3:ChartPlotter Name="Plotter01" Grid.Row="0" Grid.Column="0" Height="Auto" Width="Auto"  >
            <d3:RectangleHighlight Name="Bersaglio" Bounds="-1,-1,2,2" StrokeThickness="2" Fill="Blue" ToolTip="Sample region"></d3:RectangleHighlight>
            <d3:HorizontalAxisTitle FontSize="12">Spostamento mediolaterale</d3:HorizontalAxisTitle>
            <d3:VerticalAxisTitle FontSize="12">Spostamento anteroposteriore</d3:VerticalAxisTitle>

 I set the location and size of the rectangle with the command Bounds="-1, -1, 2, 2"

how can I move my rectangle by code??? (C#)

I tried:  

this.Bersaglio.Bounds.X = 2.0;

but does not work.

Apr 10, 2011 at 7:53 PM

I think you need to modify the entire rectangle i.e.

this.Bersaglio.Bounds = new DataRect(-2,-1,2,2);
Apr 11, 2011 at 8:21 AM

You can dynamically change it by the following code...

            Rect visibleRect = new Rect(xAxisMin, yAxisMin, (xAxisMax - xAxisMin), (yAxisMax - yAxisMin));
            plotter.Viewport.Visible = visibleRect;