コード例 #1
0
ファイル: ChartPanel.cs プロジェクト: anndream/StockCharts-1
        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
ファイル: LineChart.cs プロジェクト: anndream/StockCharts-1
        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);
        }