示例#1
0
        public ChartPanel(ChartOptions options)
        {
            this.SeriesType = options.SeriesType;
            this.IndicatorType = options.IndicatorType;
            this.ChartDrawing = ChartDrawingHelper.GetChartDrawing(SeriesType, IndicatorType);
            this.ChartData = options.ChartData;
            this.ChartStyle = options.ChartStyle;

            if (this.ChartStyle == null)
                this.ChartStyle = new DefaultChartStyle();

            SizeChanged += ChartPanel_SizeChanged;
        }
示例#2
0
        public void Draw(DrawingContext dc, List<Point> filteredPoints, ChartStyle chartStyle)
        {
            var geometry = new StreamGeometry();
            using (StreamGeometryContext context = geometry.Open())
            {
                context.BeginFigure(filteredPoints[0], false, false);
                context.PolyLineTo(filteredPoints, true, true);
            }
            geometry.Freeze();

            Pen pen = new Pen(chartStyle.LineColor, 1);

            dc.DrawGeometry(null, pen, geometry);
        }