Example #1
0
        /// <summary>
        /// Constructor. Initializes all the class fields.
        /// </summary>
        public XYLineChart()
        {
            // This assumes that you are navigating to this scene.
            // If you will normally instantiate it via code and display it
            // manually, you either have to call InitializeComponent by hand or
            // uncomment the following line.

            InitializeComponent();

            primitiveList = new List <ChartPrimitive>();

            // Set the Chart Geometry Clip region
            chartClip = new PathGeometry();
            chartClip.AddGeometry(
                new RectangleGeometry(new Rect(0, 0, clippedPlotCanvas.ActualWidth, clippedPlotCanvas.ActualHeight)));
            shapeTransform = new MatrixTransform();
            adorner        = new AdornerCursorCoordinateDrawer(this, clippedPlotCanvas, shapeTransform);

            optimalGridLineSpacing = new Point(150, 75);

            panZoomCalculator =
                new PanZoomCalculator(new Rect(0, 0, clippedPlotCanvas.ActualWidth, clippedPlotCanvas.ActualHeight));
            panZoomCalculator.Window          = new Rect(0, 0, clippedPlotCanvas.ActualWidth, clippedPlotCanvas.ActualHeight);
            panZoomCalculator.PanZoomChanged += panZoomCalculator_PanZoomChanged;

            closestPointPicker = new ClosestPointPicker(new Size(13, 13));
            closestPointPicker.ClosestPointChanged += closestPointPicker_ClosestPointChanged;

            Cursor = Cursors.None;

            // Set up all the message handlers for the clipped plot canvas
            AttachEventsToCanvas(this);
            clippedPlotCanvas.IsVisibleChanged += clippedPlotCanvas_IsVisibleChanged;
            clippedPlotCanvas.SizeChanged      += clippedPlotCanvas_SizeChanged;
        }
Example #2
0
        /// <summary>
        /// Constructor. Initializes all the class fields.
        /// </summary>
        public XYLineChart()
        {
            // This assumes that you are navigating to this scene.
            // If you will normally instantiate it via code and display it
            // manually, you either have to call InitializeComponent by hand or
            // uncomment the following line.

            InitializeComponent();

            primitiveList = new List<ChartPrimitive>();

            // Set the Chart Geometry Clip region
            chartClip = new PathGeometry();
            chartClip.AddGeometry(
                new RectangleGeometry(new Rect(0, 0, clippedPlotCanvas.ActualWidth, clippedPlotCanvas.ActualHeight)));
            shapeTransform = new MatrixTransform();
            adorner = new AdornerCursorCoordinateDrawer(this, clippedPlotCanvas, shapeTransform);

            optimalGridLineSpacing = new Point(150, 75);

            panZoomCalculator =
                new PanZoomCalculator(new Rect(0, 0, clippedPlotCanvas.ActualWidth, clippedPlotCanvas.ActualHeight));
            panZoomCalculator.Window = new Rect(0, 0, clippedPlotCanvas.ActualWidth, clippedPlotCanvas.ActualHeight);
            panZoomCalculator.PanZoomChanged += panZoomCalculator_PanZoomChanged;

            closestPointPicker = new ClosestPointPicker(new Size(13, 13));
            closestPointPicker.ClosestPointChanged += closestPointPicker_ClosestPointChanged;

            Cursor = Cursors.None;

            // Set up all the message handlers for the clipped plot canvas
            AttachEventsToCanvas(this);
            clippedPlotCanvas.IsVisibleChanged += clippedPlotCanvas_IsVisibleChanged;
            clippedPlotCanvas.SizeChanged += clippedPlotCanvas_SizeChanged;
        }