Exemplo n.º 1
0
        public ACProFunctionChart(ChartView BaseChart)
        {
#if !TEE_STD
            this.acFunction = new ACFunction();
            this.candle     = new Candle();
            this.volume     = new Volume();
            this.myAxisLeft = new Axis();
            this.BaseChart  = BaseChart;
            this.var        = new Variables.Variables();

            Themes.CandleGodStyle(candle);

            BaseChart.Chart.Header.Text = "Acceleration/Deceleration Indicator (AC)";

            BaseChart.Chart.Series.Add(candle);
            BaseChart.Chart.Series.Add(volume);
            BaseChart.Chart.Axes.Custom.Add(myAxisLeft);

            BaseChart.Chart.Axes.Left.RelativePosition   = 0;
            BaseChart.Chart.Axes.Left.StartPosition      = 0;
            BaseChart.Chart.Axes.Left.EndPosition        = 55;
            BaseChart.Chart.Axes.Left.Automatic          = true;
            BaseChart.Chart.Axes.Left.Ticks.Transparency = 100;
            BaseChart.Chart.Axes.Left.Increment          = 15;

            BaseChart.Chart.Axes.Bottom.RelativePosition = 0;
            BaseChart.Chart.Axes.Bottom.StartPosition    = 0;
            BaseChart.Chart.Axes.Bottom.EndPosition      = 100;
            BaseChart.Chart.Axes.Bottom.Automatic        = true;

            myAxisLeft = Themes.CustomAxisLeft(myAxisLeft);

            FillSampleValues(candle, 20, 200);
            candle.HorizAxis = HorizontalAxis.Bottom;
            candle.VertAxis  = VerticalAxis.Left;
            candle.Title     = "Data Source";

            volume.HorizAxis      = HorizontalAxis.Bottom;
            volume.VertAxis       = VerticalAxis.Custom;
            volume.CustomVertAxis = myAxisLeft;
            volume.Function       = acFunction;
            volume.DataSource     = candle;
            volume.Title          = "AC";
            volume.LinePen.Width  = 3;

            acFunction.Period = 2;
            acFunction.Series = candle;
#endif
        }
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;

            tChart1.Series.Add(series1);
            tChart1.Series.Add(series2);

            series1.FillSampleValues(200);

            ACFunction func = new ACFunction(tChart1.Chart);

            series2.Function   = func;
            series2.DataSource = series1;

            Axis custom = new Axis(tChart1.Chart);

            custom.Horizontal             = false;
            tChart1.Axes.Left.EndPosition = 70;
            custom.StartPosition          = 70;
            custom.EndPosition            = 100;
            tChart1.Axes.Custom.Add(custom);
            series2.CustomVertAxis = custom;
        }