// ********************************************************************
        // Public Methods
        // ********************************************************************
        #region Public Methods

        /// <summary>
        /// Constructor. Initializes all the class fields.
        /// </summary>
        public ChartControl()
        {
            this.LastChildFill    = true;
            this.IsHitTestVisible = true;
            this.Background       = new SolidColorBrush(Color.FromArgb(1, 255, 255, 255));

            AddChildControls();

            Oversize = 0.01;

            _primitiveList  = new List <ChartPrimitive>();
            _shapeTransform = new MatrixTransform();

            _cursorCoordinateCanvas.PrimitiveList      = _primitiveList;
            _cursorCoordinateCanvas.PrimitiveTransform = _shapeTransform;

            _plotRenderer = new PlotRenderer();
            _plotRenderer.PrimitiveList      = _primitiveList;
            _plotRenderer.PrimitiveTransform = _shapeTransform;

            _gridLineCanvas.XGridLineLabelBar = _xGridLineLabels;
            _gridLineCanvas.YGridLineLabelBar = _yGridLineLabels;

            _gridLineCanvas.XAxisTitleBar = _xTitleBar;
            _gridLineCanvas.YAxisTitleBar = _yTitleBar;

            _panZoomCalculator                 = new PanZoomCalculator(CanvasRect);
            _panZoomCalculator.Window          = CanvasRect;
            _panZoomCalculator.PanZoomChanged += new EventHandler <PanZoomArgs>(panZoomCalculator_PanZoomChanged);

            this.Cursor = defaultCursor;

            // Set up all the message handlers for the clipped plot canvas
            AttachEventsToCanvas(this);

            _gridLineCanvas.SizeChanged += new SizeChangedEventHandler(canvas_SizeChanged);

            YAxisTitle = "Y Axis Label";

            _imageHost.Source = _plotRenderer.ImageSource;

            this.PlotResized += ChartControl_PlotResized;
        }
Exemplo n.º 2
0
    // ********************************************************************
    // Public Methods
    // ********************************************************************
    #region Public Methods

    /// <summary>
    /// Constructor. Initializes all the class fields.
    /// </summary>
    public ChartControl() {

      this.LastChildFill = true;
      this.IsHitTestVisible = true;
      this.Background = new SolidColorBrush(Color.FromArgb(1,255,255,255));

      AddChildControls();

      Oversize = 0.01;

      _primitiveList = new List<ChartPrimitive>();
      _shapeTransform = new MatrixTransform();

      _cursorCoordinateCanvas.PrimitiveList = _primitiveList;
      _cursorCoordinateCanvas.PrimitiveTransform = _shapeTransform;

      _plotRenderer = new PlotRenderer();
      _plotRenderer.PrimitiveList = _primitiveList;
      _plotRenderer.PrimitiveTransform = _shapeTransform;

      _gridLineCanvas.XGridLineLabelBar = _xGridLineLabels;
      _gridLineCanvas.YGridLineLabelBar = _yGridLineLabels;

      _gridLineCanvas.XAxisTitleBar = _xTitleBar;
      _gridLineCanvas.YAxisTitleBar = _yTitleBar;

      _panZoomCalculator = new PanZoomCalculator(CanvasRect);
      _panZoomCalculator.Window = CanvasRect;
      _panZoomCalculator.PanZoomChanged += new EventHandler<PanZoomArgs>(panZoomCalculator_PanZoomChanged);

      this.Cursor = defaultCursor;

      // Set up all the message handlers for the clipped plot canvas
      AttachEventsToCanvas(this);

      _gridLineCanvas.SizeChanged += new SizeChangedEventHandler(canvas_SizeChanged);

      YAxisTitle = "Y Axis Label";

      _imageHost.Source = _plotRenderer.ImageSource;

      this.PlotResized += ChartControl_PlotResized;

    }