Exemplo n.º 1
0
        public void SetAxisLabel(Steema.TeeChart.Axis axis, Steema.TeeChart.AxisLabelStyle axisLabelStyle, bool p_GridVisible)
        {
            axis.Labels.Visible = true;
            axis.Labels.Style   = axisLabelStyle;
            axis.Grid.Visible   = p_GridVisible;

            //			axis.Labels.Font.Size = 7;
            //			axis.Labels.Font.Name = "Tahoma";
        }
Exemplo n.º 2
0
        /// <summary>
        /// Find an existing axis with the same units, or create one, and assign this series to it.
        /// Also enter units as the axis text
        /// </summary>
        /// <param name="series"></param>
        /// <param name="units"></param>
        public static void SetupMultiLeftAxis(TChart chart1, Steema.TeeChart.Styles.Line series, string units)
        {
            string leftUnits = chart1.Axes.Left.Title.Text;

            if (leftUnits == "" || leftUnits == units)
            {
                series.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left;
                if (leftUnits == "")
                {
                    chart1.Axes.Left.Title.Text = units;
                }

                return; // default axis ok.
            }
            //string rightUnits = chart1.Axes.Right.Title.Text;
            //if (rightUnits == "" || rightUnits == units)
            //{
            //    series.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
            //    if (rightUnits == "")
            //        chart1.Axes.Right.Title.Text = units;

            //    return; // default axis ok.
            //}

            int customCount = 0;

            for (int i = 0; i < chart1.Axes.Custom.Count; i++)
            {
                if (chart1.Axes.Custom[i].IsCustom())
                {
                    customCount++;
                }
                if (chart1.Axes.Custom[i].Title.Text.IndexOf(units) >= 0)
                {
                    series.CustomVertAxis = chart1.Axes.Custom[i];
                    return;
                }
            }
            // add new custom axis.

            var axis1 = new Steema.TeeChart.Axis();

            chart1.Axes.Custom.Add(axis1);

            //axis1.OtherSide = false;
            chart1.Panel.MarginLeft += 5D;
            axis1.RelativePosition   = -10 * (customCount + 1);
            axis1.Grid.Visible       = false;
            axis1.Title.Angle        = 90;
            //axis1.Title.Caption = "custom";
            series.CustomVertAxis = axis1;
            axis1.Title.Text      = units;
        }
Exemplo n.º 3
0
        public void SetAxisMinMax(Steema.TeeChart.Axis axis, int OffsetMin, int OffsetMax)
        {
            if (axis.Horizontal == true)
            {
                //				axis.Automatic = true;
                //				axis.MinimumOffset = OffsetMin;
                //				axis.MaximumOffset = OffsetMax;

                if (axis.MaxXValue == axis.MinXValue)
                {
                    if (axis.MaxXValue == 0)
                    {
                        SetAxisMinMax(axis, Convert.ToDouble(0), Convert.ToDouble(3));
                    }
                    else
                    {
                        axis.Automatic     = true;
                        axis.MinimumOffset = OffsetMin;
                        axis.MaximumOffset = OffsetMax;
                    }
                }
                else
                {
                    axis.Automatic     = true;
                    axis.MinimumOffset = OffsetMin;
                    axis.MaximumOffset = OffsetMax;
                }
            }
            else
            {
                if (axis.MaxYValue == axis.MinYValue)
                {
                    if (axis.MaxYValue == 0)
                    {
                        SetAxisMinMax(axis, Convert.ToDouble(-3), Convert.ToDouble(3));
                    }
                    else
                    {
                        axis.Automatic     = true;
                        axis.MinimumOffset = OffsetMin;
                        axis.MaximumOffset = OffsetMax;
                    }
                }
                else
                {
                    axis.Automatic     = true;
                    axis.MinimumOffset = OffsetMin;
                    axis.MaximumOffset = OffsetMax;
                }
            }
        }
Exemplo n.º 4
0
        // Trace Data Chart에 Interlock정보, Glass정보를 나타내기 위한 Custom Axis 추가
        public void AddCustomVertAxis(TChart objChart, Axis p_faultAxis, Axis p_labelAxis)
        {
            // Chart 상측 2% 위치에 Interlock 정보 표시
            p_faultAxis = new Steema.TeeChart.Axis();
            objChart.Axes.Custom.Add(p_faultAxis);

            p_faultAxis.PositionUnits   = Steema.TeeChart.PositionUnits.Pixels;
            p_faultAxis.StartPosition   = 0;
            p_faultAxis.EndPosition     = 2;
            p_faultAxis.Horizontal      = false;
            p_faultAxis.OtherSide       = false;
            p_faultAxis.AxisPen.Visible = false;
            p_faultAxis.Labels.Visible  = false;
            p_faultAxis.SetMinMax(0, 1);


            // Chart 하측 10% 위치에 Glass 정보 표시
            p_labelAxis = new Steema.TeeChart.Axis();
            objChart.Axes.Custom.Add(p_labelAxis);

            p_labelAxis.PositionUnits   = Steema.TeeChart.PositionUnits.Pixels;
            p_labelAxis.StartPosition   = 90;
            p_labelAxis.EndPosition     = 100;
            p_labelAxis.Horizontal      = false;
            p_labelAxis.OtherSide       = false;
            p_labelAxis.AxisPen.Visible = false;
            p_labelAxis.Labels.Visible  = false;
            p_labelAxis.SetMinMax(0, 1);

            // Trace Chart를 Chart의 2%-90%에 표시
            objChart.Axes.Left.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
            objChart.Axes.Left.StartPosition = 2;
            objChart.Axes.Left.EndPosition   = 90;

            objChart.Axes.Right.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
            objChart.Axes.Right.StartPosition = 2;
            objChart.Axes.Right.EndPosition   = 90;
        }
Exemplo n.º 5
0
        protected void DrawChartWithSeriesInfoDot()
        {
            Steema.TeeChart.Axis          axis = null;
            Steema.TeeChart.Styles.Points s;
            DataTable dt = null;

            this.AnalysisChart.Chart.Series.Clear();
            int iOldEnd = 0;

            for (int i = 0; i < _llstSortingKey.Count; i++)
            {
                int    iEnd            = 0;
                string strSortingValue = _llstSortingKey.GetKey(i).ToString();
                string strSortingKey   = _llstSortingKey.GetValue(i).ToString();
                Color  c = GetSeriesColor(i);

                s = new Points();
                this.AnalysisChart.Chart.Series.Add(s);

                s.Color         = c;
                s.Pointer.Style = PointerStyles.Circle;
                s.Title         = strSortingValue;

                //s.BoxSize =2;
                foreach (DataRow dr in this.dtDataSource.Rows)
                {
                    string sSortingKey = dr[strSortingKey].ToString();
                    int    dCount      = int.Parse(dr[Definition.CHART_COLUMN.SAMPLE_COUNT].ToString());
                    int    iIndex      = int.Parse(dr[CommonChart.COLUMN_NAME_SEQ_INDEX].ToString());
                    double dData       = double.Parse(dr[Definition.CHART_COLUMN.VALUE].ToString());

                    if (sSortingKey.Equals(strSortingValue))
                    {
                        if (dCount > iEnd)
                        {
                            iEnd = dCount;
                        }
                        s.Add(iIndex, dCount, c);
                    }
                    else
                    {
                        s.Add(iIndex, -999, c);
                    }
                }

                if (i == 0)
                {
                    axis = this.AnalysisChart.Chart.Axes.Left;
                    axis.StartPosition = 0;
                    axis.EndPosition   = 100 / _llstSortingKey.Count;
                    axis.Minimum       = 0;
                    axis.Maximum       = iEnd;
                    axis.SetMinMax(0, iEnd * 2);
                }
                else
                {
                    axis = new Axis(false, false, this.AnalysisChart.Chart.Chart);
                    this.AnalysisChart.Chart.Axes.Custom.Add(axis);
                    s.CustomVertAxis   = axis;
                    axis.StartPosition = 100 / _llstSortingKey.Count * i;
                    axis.EndPosition   = 100 / _llstSortingKey.Count * (i + 1);
                    axis.Minimum       = iOldEnd;
                    axis.Maximum       = (iOldEnd + iEnd);
                    axis.SetMinMax(0, iEnd * 2);
                }

                axis.AxisPen.Color    = c;
                axis.Title.Font.Color = c;
                axis.Title.Font.Bold  = true;
                axis.Title.Text       = strSortingValue;
                axis.Title.Angle      = 90;
                axis.Grid.Visible     = false;
                axis.AxisPen.Visible  = false;
                axis.MinAxisIncrement = 1;

                iOldEnd = iEnd;
                for (int index = 0; index < this.dtDataSource.Rows.Count; index++)
                {
                    s.Labels[index] = this.dtDataSource.Rows[index][Definition.CHART_COLUMN.VALUE].ToString();
                }
            }

            this.AnalysisChart.Chart.Axes.Bottom.Labels.Angle = 90;
            this.AnalysisChart.Chart.Invalidate();
        }
Exemplo n.º 6
0
        protected void DrawChartWithSeriesInfoHist()
        {
            Steema.TeeChart.Axis             axis = null;
            Steema.TeeChart.Styles.Histogram s;
            DataTable dt = null;

            this.AnalysisChart.Chart.Series.Clear();
            this.AnalysisChart.SetXAxisRegularInterval(true);

            int iOldEnd = 0;

            for (int i = 0; i < _llstSortingKey.Count; i++)
            {
                int    iEnd            = 0;
                double min             = 0;
                double max             = 0;
                string strSortingValue = _llstSortingKey.GetKey(i).ToString();
                string strSortingKey   = _llstSortingKey.GetValue(i).ToString();
                Color  c = GetSeriesColor(i);
                s              = new Histogram();
                s.Color        = c;
                s.Title        = strSortingValue;
                s.XValues.Name = Definition.CHART_COLUMN.VALUE;

                this.AnalysisChart.Chart.Series.Add(s);
                foreach (DataRow dr in this.dtDataSource.Rows)
                {
                    string sSortingKey = dr[strSortingKey].ToString();
                    int    dCount      = int.Parse(dr[Definition.CHART_COLUMN.SAMPLE_COUNT].ToString());
                    int    iIndex      = int.Parse(dr[CommonChart.COLUMN_NAME_SEQ_INDEX].ToString());
                    double dData       = double.Parse(dr[Definition.CHART_COLUMN.VALUE].ToString());


                    if (sSortingKey.Equals(strSortingValue))
                    {
                        if (dCount > iEnd)
                        {
                            iEnd = dCount;
                        }
                        s.Add(iIndex, dCount, c);
                        if (dData > min)
                        {
                            max = dData;
                        }
                        else
                        {
                            min = dData;
                        }
                    }
                    else
                    {
                        s.Add(iIndex, -999, c);
                    }
                }
                for (int index = 0; index < this.dtDataSource.Rows.Count; index++)
                {
                    s.Labels[index] = this.dtDataSource.Rows[index][Definition.CHART_COLUMN.VALUE].ToString();
                }
                iOldEnd = iEnd;
            }
            this.AnalysisChart.Chart.Axes.Left.Maximum          = iOldEnd;
            this.AnalysisChart.Chart.Axes.Left.Minimum          = 0;
            this.AnalysisChart.Chart.Axes.Left.MinAxisIncrement = 1;
            this.AnalysisChart.Chart.Axes.Left.MinorTickCount   = 0;
            this.AnalysisChart.Chart.Axes.Left.SetMinMax(0, iOldEnd);
            this.AnalysisChart.Chart.Axes.Left.MinimumOffset    = 0;
            this.AnalysisChart.Chart.Axes.Left.MaximumOffset    = iOldEnd + 1;
            this.AnalysisChart.Chart.Axes.Bottom.MinorTickCount = 0;
        }
Exemplo n.º 7
0
        protected void DrawChartWithSeriesInfoBox()
        {
            Steema.TeeChart.Axis       axis = null;
            Steema.TeeChart.Styles.Box s;
            DataTable     dt = null;
            List <double> lstValue;

            this.AnalysisChart.Chart.Series.Clear();
            this.AnalysisChart.SetXAxisRegularInterval(true);

            for (int i = 0; i < _llstSortingKey.Count; i++)
            {
                string strSortingValue = _llstSortingKey.GetKey(i).ToString();
                string strSortingKey   = _llstSortingKey.GetValue(i).ToString();
                Color  c = GetSeriesColor(i);

                s              = new Box();
                s.Color        = c;
                s.Title        = strSortingValue;
                s.XValues.Name = strSortingValue;
                this.AnalysisChart.Chart.Series.Add(s);
                lstValue = new List <double>();
                dt       = DataUtil.DataTableImportRow(this.dtDataSource.Select(string.Format("{0} = '{1}'", strSortingKey, strSortingValue)));
                foreach (DataRow dr in dt.Rows)
                {
                    if (string.IsNullOrEmpty(dr[Definition.CHART_COLUMN.VALUE].ToString()))
                    {
                        continue;
                    }
                    lstValue.Add((double)dr[Definition.CHART_COLUMN.VALUE]);
                    // s.Add(i, (double)dr[Definition.CHART_COLUMN.VALUE], c);
                }
                s.Add(lstValue.ToArray());
                s.ReconstructFromData();
                if (i == 0)
                {
                    axis                  = this.AnalysisChart.Chart.Axes.Bottom;
                    axis.Horizontal       = true;
                    axis.StartPosition    = 0;
                    axis.EndPosition      = 100 / _llstSortingKey.Count;
                    axis.AxisPen.Color    = c;
                    axis.Title.Font.Color = c;
                    axis.Title.Font.Bold  = true;
                    axis.Title.Text       = strSortingValue;
                    axis.LogarithmicBase  = 2;
                    axis.Grid.Visible     = false;
                    axis.AxisPen.Visible  = false;
                }
                else
                {
                    axis = new Axis(true, false, this.AnalysisChart.Chart.Chart);
                    this.AnalysisChart.Chart.Axes.Custom.Add(axis);
                    s.CustomHorizAxis     = axis;
                    axis.StartPosition    = 100 / _llstSortingKey.Count * i;
                    axis.EndPosition      = 100 / _llstSortingKey.Count * (i + 1);
                    axis.AxisPen.Color    = c;
                    axis.Title.Font.Color = c;
                    axis.Title.Font.Bold  = true;
                    axis.Title.Text       = strSortingValue;
                    axis.LogarithmicBase  = 2;
                    axis.Grid.Visible     = false;
                    axis.AxisPen.Visible  = false;
                }
                axis.Labels.Angle = 90;
                axis.Title.Angle  = 90;
            }
            this.AnalysisChart.Chart.Axes.Bottom.Labels.Angle = 90;
            this.AnalysisChart.Chart.Axes.Left.MinorTickCount = 0;
            //this.AnalysisChart.Chart.Axes.Left.MinAxisIncrement = .25;
            //this.AnalysisChart.Chart.Axes.Left.SetMinMax(0,5);
        }
Exemplo n.º 8
0
 public void SetAxisTitle(Steema.TeeChart.Axis axis, string Title)
 {
     axis.Title.Text    = Title;
     axis.Title.Visible = true;
 }
Exemplo n.º 9
0
 public void SetAxisMinMax(Steema.TeeChart.Axis axis, DateTime FromDateTime, DateTime ToDateTime)
 {
     axis.Automatic = false;
     axis.SetMinMax(FromDateTime, ToDateTime);
 }
Exemplo n.º 10
0
 public void SetAxisMinMax(Steema.TeeChart.Axis axis, double MinValue, double MaxValue)
 {
     axis.Automatic = false;
     axis.SetMinMax(MinValue, MaxValue);
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            //any additional setup after loading the view, typically from a nib.
            r1 = new System.Drawing.RectangleF(0, 0, (float)this.View.Bounds.Width / 2, (float)this.View.Bounds.Height / 2);
            r2 = new System.Drawing.RectangleF((float)this.View.Bounds.Width / 2, 0, (float)this.View.Bounds.Width / 2, (float)this.View.Bounds.Height / 2);
            r3 = new System.Drawing.RectangleF(0, (float)this.View.Bounds.Height / 2, (float)this.View.Bounds.Width, (float)this.View.Bounds.Height / 2);

            chart1.Frame = r1;
            chart2.Frame = r2;
            chart3.Frame = r3;

            chart1.Header.Visible = false;
            chart1.Legend.Visible = false;
            chart2.Header.Visible = false;
            chart3.Header.Visible = false;

            this.View.AddSubview(chart1);
            this.View.AddSubview(chart2);
            this.View.AddSubview(chart3);

            Steema.TeeChart.Themes.BlackIsBackTheme theme1 = new Steema.TeeChart.Themes.BlackIsBackTheme(chart1.Chart);
            Steema.TeeChart.Themes.BlackIsBackTheme theme2 = new Steema.TeeChart.Themes.BlackIsBackTheme(chart2.Chart);
            Steema.TeeChart.Themes.BlackIsBackTheme theme3 = new Steema.TeeChart.Themes.BlackIsBackTheme(chart3.Chart);


            Steema.TeeChart.Themes.ColorPalettes.ApplyPalette(chart1.Chart, Steema.TeeChart.Themes.Theme.OnBlackPalette);
            Steema.TeeChart.Themes.ColorPalettes.ApplyPalette(chart2.Chart, Steema.TeeChart.Themes.Theme.OnBlackPalette);
            Steema.TeeChart.Themes.ColorPalettes.ApplyPalette(chart3.Chart, Steema.TeeChart.Themes.Theme.OnBlackPalette);

            // Chart 1
            chart1.Panel.Gradient.Visible = false;
            chart1.Panel.Color            = Color.Black;
            Steema.TeeChart.Styles.Donut series1 = new Steema.TeeChart.Styles.Donut();
            chart1.Aspect.View3D = false;
            series1.FillSampleValues(4);
            series1.Circled           = true;
            series1.Pen.Width         = 5;
            series1.ExplodeBiggest    = 20;
            series1.Marks.Transparent = true;
            series1.Marks.Font.Color  = Color.FromArgb(144, 255, 255, 255);
            series1.Marks.Font.Size   = 20;
            chart1.Series.Add(series1);

            // Chart 2

            chart2.Aspect.View3D = false;
            chart2.Chart.Aspect.ZoomScrollStyle = Steema.TeeChart.Drawing.Aspect.ZoomScrollStyles.Manual;
            chart2.Panel.Gradient.Visible       = false;
            chart2.Panel.Color = Color.Black;
            chart2.Walls.Back.Gradient.Visible    = true;
            chart2.Walls.Back.Gradient.StartColor = Color.FromArgb(255, 0, 0, 0);
            chart2.Walls.Back.Gradient.EndColor   = Color.DarkGray;
            chart2.Axes.Bottom.Grid.Visible       = false;
            chart2.Axes.Left.Increment            = 15;
            chart2.Axes.Bottom.Labels.Font.Size   = 15;
            chart2.Legend.Alignment   = LegendAlignments.Bottom;
            chart2.Legend.Transparent = true;
            Steema.TeeChart.Styles.Line series2 = new Steema.TeeChart.Styles.Line();
            series2.Add(15);
            series2.Add(25);
            series2.Add(16);
            series2.Add(30);
            series2.Add(40);
            series2.Add(35);
            series2.Add(25);
            series2.Add(50);
            series2.Pointer.Visible     = true;
            series2.Pointer.Style       = Steema.TeeChart.Styles.PointerStyles.Circle;
            series2.LinePen.Width       = 3;
            series2.Pointer.Pen.Visible = false;
            Steema.TeeChart.Styles.Area series3 = new Steema.TeeChart.Styles.Area();
            series3.Add(10);
            series3.Add(15);
            series3.Add(6);
            series3.Add(15);
            series3.Add(10);
            series3.Add(25);
            series3.Add(20);
            series3.Add(24);
            series3.AreaLinesPen.Visible        = true;
            series3.AreaLinesPen.Width          = 3;
            series3.AreaLinesPen.Color          = series3.Color;
            series3.LinePen.Visible             = true;
            series3.LinePen.Width               = 5;
            series3.AreaLines.Visible           = false;
            series3.AreaBrush.Gradient.Visible  = true;
            series3.AreaBrush.Gradient.EndColor = Color.DarkGray;
            chart2.Series.Add(series2);
            chart2.Series.Add(series3);

            // Chart 3

            chart3.Aspect.View3D  = false;
            chart3.Legend.Visible = false;
            chart3.Chart.Aspect.ZoomScrollStyle = Steema.TeeChart.Drawing.Aspect.ZoomScrollStyles.Manual;
            chart3.Panel.Gradient.Visible       = false;
            chart3.Panel.Color = Color.Black;
            chart3.Walls.Back.Gradient.Visible    = true;
            chart3.Walls.Back.Gradient.StartColor = Color.Black;
            chart3.Walls.Back.Gradient.EndColor   = Color.FromArgb(255, 79, 79, 79);
            chart3.Axes.Left.Labels.Separation    = 100;
            chart3.Axes.Left.Grid.Visible         = true;
            chart3.Axes.Left.Grid.Color           = Color.FromArgb(255, 79, 79, 79);
            chart3.Axes.Bottom.Grid.Color         = Color.FromArgb(255, 79, 79, 79);
            chart3.Axes.Left.AxisPen.Visible      = false;

            Steema.TeeChart.Styles.Candle candle = new Steema.TeeChart.Styles.Candle();
            Steema.TeeChart.Styles.Volume volume = new Steema.TeeChart.Styles.Volume();

            chart3.Series.Add(candle);
            chart3.Series.Add(volume);

            candle.FillSampleValues(70);
            candle.Pen.Visible = false;

            volume.FillSampleValues(70);
            volume.Color = Color.Yellow;

            Steema.TeeChart.Axis axis = chart3.Axes.Left;

            axis.StartPosition    = 0;
            axis.EndPosition      = 72;
            axis.Labels.Font.Size = 12;

            Steema.TeeChart.Axis customAxis = new Steema.TeeChart.Axis(chart3.Chart);
            customAxis.OtherSide = true;
            chart3.Axes.Custom.Add(customAxis);

            customAxis.StartPosition     = 74;
            customAxis.EndPosition       = 100;
            customAxis.Labels.Font.Color = Color.FromArgb(255, 255, 255, 240);
            customAxis.Labels.Font.Size  = 12;
            customAxis.Grid.Visible      = false;
            customAxis.AxisPen.Visible   = false;

            volume.CustomVertAxis = customAxis;

            chart3.Legend.Alignment   = LegendAlignments.Bottom;
            chart3.Legend.Transparent = true;
            chart3.Legend.Font.Size   = 12;
            chart3.Legend.TopLeftPos  = 0;

            chart3.Axes.Bottom.Labels.Font.Size = 12;


            /* Chart 4
             *
             * chart4.Aspect.View3D = false;
             * chart4.Chart.Aspect.ZoomScrollStyle = Steema.TeeChart.Drawing.Aspect.ZoomScrollStyles.Manual;
             * chart4.Panel.Gradient.Visible = false;
             * chart4.Panel.Color = UIColor.Black.CGColor;
             * chart4.Walls.Back.Transparent=true;
             * Steema.TeeChart.Styles.HorizBar series5 = new Steema.TeeChart.Styles.HorizBar();
             * series5.Add(10);
             * series5.Add(50);
             * series5.Add(30);
             * series5.Add(70);
             * //series5.BarHeightPercent=100;
             * //series5.CustomBarWidth= 80;
             * series5.ColorEach = true;
             * //series5.Pen.Width = 3;
             * //series5.Gradient.Visible = true;
             * chart4.Series.Add(series5);
             * chart4.Axes.Bottom.Visible = false;
             */
        }
Exemplo n.º 12
0
        /// <summary>
        /// Find an existing axis with the same units, or create one, and assign this series to it.  
        /// Also enter units as the axis text
        /// </summary>
        /// <param name="series"></param>
        /// <param name="units"></param>
        public static void SetupMultiLeftAxis( TChart chart1, Steema.TeeChart.Styles.Line series, string units)
        {
            string leftUnits = chart1.Axes.Left.Title.Text;
            if (  leftUnits == "" ||  leftUnits == units)
            {
                series.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left;
                if (leftUnits == "")
                    chart1.Axes.Left.Title.Text = units;

                return; // default axis ok.
            }
            //string rightUnits = chart1.Axes.Right.Title.Text;
            //if (rightUnits == "" || rightUnits == units)
            //{
            //    series.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
            //    if (rightUnits == "")
            //        chart1.Axes.Right.Title.Text = units;

            //    return; // default axis ok.
            //}

            int customCount = 0;
            for (int i = 0; i < chart1.Axes.Custom.Count; i++)
            {
                if (chart1.Axes.Custom[i].IsCustom())
                    customCount++;
                if (chart1.Axes.Custom[i].Title.Text.IndexOf(units) >= 0)
                {
                    series.CustomVertAxis = chart1.Axes.Custom[i];
                    return;
                }
            }
            // add new custom axis.

            var axis1 = new Steema.TeeChart.Axis();
            chart1.Axes.Custom.Add(axis1);

            //axis1.OtherSide = false;
            chart1.Panel.MarginLeft += 5D;
            axis1.RelativePosition = -10 * (customCount+1);
            axis1.Grid.Visible = false;
            axis1.Title.Angle = 90;
            //axis1.Title.Caption = "custom";
            series.CustomVertAxis = axis1;
            axis1.Title.Text = units;
        }
Exemplo n.º 13
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			//any additional setup after loading the view, typically from a nib.
			r1 = new System.Drawing.RectangleF(0,0,this.View.Bounds.Width/2,this.View.Bounds.Height/2);						
			r2 = new System.Drawing.RectangleF(this.View.Bounds.Width/2,0,this.View.Bounds.Width/2,this.View.Bounds.Height/2);						
			r3 = new System.Drawing.RectangleF(0,this.View.Bounds.Height/2,this.View.Bounds.Width,this.View.Bounds.Height/2);						
			//r3 = new System.Drawing.RectangleF(0,this.View.Bounds.Height/2,this.View.Bounds.Width/2,this.View.Bounds.Height/2);						
			// r4 = new System.Drawing.RectangleF(this.View.Bounds.Width/2,this.View.Bounds.Height/2,this.View.Bounds.Width/2,this.View.Bounds.Height/2);	
					
			chart1.Frame = r1;
			chart2.Frame = r2;
			chart3.Frame = r3;
			//chart4.Frame = r4;
			
			chart1.Header.Visible = false;
			chart1.Legend.Visible = false;
			chart2.Header.Visible = false;
			chart3.Header.Visible = false;
			//chart4.Header.Visible = false;
			
			this.View.AddSubview(chart1);
			this.View.AddSubview(chart2);
			this.View.AddSubview(chart3);
			//this.View.AddSubview(chart4);
			
			Steema.TeeChart.Themes.BlackIsBackTheme theme1 = new Steema.TeeChart.Themes.BlackIsBackTheme(chart1.Chart);
			Steema.TeeChart.Themes.BlackIsBackTheme theme2 = new Steema.TeeChart.Themes.BlackIsBackTheme(chart2.Chart);
			Steema.TeeChart.Themes.BlackIsBackTheme theme3 = new Steema.TeeChart.Themes.BlackIsBackTheme(chart3.Chart);
			//Steema.TeeChart.Themes.BlackIsBackTheme theme4 = new Steema.TeeChart.Themes.BlackIsBackTheme(chart4.Chart);
			
			theme1.Apply();
			theme2.Apply();
			theme3.Apply();
			//theme4.Apply();
			
			Steema.TeeChart.Themes.ColorPalettes.ApplyPalette(chart1.Chart,Steema.TeeChart.Themes.Theme.OnBlackPalette);	
			Steema.TeeChart.Themes.ColorPalettes.ApplyPalette(chart2.Chart,Steema.TeeChart.Themes.Theme.OnBlackPalette);	
			Steema.TeeChart.Themes.ColorPalettes.ApplyPalette(chart3.Chart,Steema.TeeChart.Themes.Theme.OnBlackPalette);	
			//Steema.TeeChart.Themes.ColorPalettes.ApplyPalette(chart4.Chart,Steema.TeeChart.Themes.Theme.OnBlackPalette);				
			
			// Chart 1
			chart1.Panel.Gradient.Visible = false;
			chart1.Panel.Color = UIColor.Black.CGColor;
			Steema.TeeChart.Styles.Donut series1 = new Steema.TeeChart.Styles.Donut();
			chart1.Aspect.View3D = false;
			series1.FillSampleValues(4);
			series1.Circled = true;
			series1.Pen.Width = 5;
			series1.ExplodeBiggest=20;
			series1.Marks.Transparent = true;
			series1.Marks.Font.Color = UIColor.FromRGB(255,255,255).CGColor;
			series1.Marks.Font.Size = 20;
			chart1.Series.Add(series1);
			  
			// Chart 2
			
			chart2.Aspect.View3D = false;
			chart2.Chart.Aspect.ZoomScrollStyle = Steema.TeeChart.Drawing.Aspect.ZoomScrollStyles.Manual;									
			chart2.Panel.Gradient.Visible = false;
			chart2.Panel.Color = UIColor.Black.CGColor;
			chart2.Walls.Back.Gradient.Visible = true;
			chart2.Walls.Back.Gradient.StartColor = UIColor.FromRGB(0,0,0).CGColor;
			chart2.Walls.Back.Gradient.EndColor = UIColor.DarkGray.CGColor;
			chart2.Axes.Bottom.Grid.Visible = false;
			chart2.Axes.Left.Increment = 15;
			chart2.Axes.Bottom.Labels.Font.Size = 15;
			chart2.Legend.Alignment = LegendAlignments.Bottom;
			chart2.Legend.Transparent = true;
			Steema.TeeChart.Styles.Line series2 = new Steema.TeeChart.Styles.Line();
			series2.Add(15);
			series2.Add(25);
			series2.Add(16);
			series2.Add(30);
			series2.Add(40);
			series2.Add(35);
			series2.Add(25);
			series2.Add(50);
			series2.Pointer.Visible = true;
			series2.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
			series2.LinePen.Width = 3;
			series2.Pointer.Pen.Visible = false;
			Steema.TeeChart.Styles.Area series3 = new Steema.TeeChart.Styles.Area();
			series3.Add(10);
			series3.Add(15);
			series3.Add(6);
			series3.Add(15);
			series3.Add(10);
			series3.Add(25);
			series3.Add(20);
			series3.Add(24);
			series3.AreaLinesPen.Visible = true;
			series3.AreaLinesPen.Width=3;
			series3.AreaLinesPen.Color = series3.Color;		
			series3.LinePen.Visible = true;
			series3.LinePen.Width = 5;
			series3.AreaLines.Visible = false;
			series3.AreaBrush.Gradient.Visible = true;
			series3.AreaBrush.Gradient.EndColor = UIColor.DarkGray.CGColor;
			chart2.Series.Add(series2);
			chart2.Series.Add(series3);

			// Chart 3
			
			chart3.Aspect.View3D = false;
			chart3.Legend.Visible = false;
			chart3.Chart.Aspect.ZoomScrollStyle = Steema.TeeChart.Drawing.Aspect.ZoomScrollStyles.Manual;									
			chart3.Panel.Gradient.Visible = false;
			chart3.Panel.Color = UIColor.Black.CGColor;
			chart3.Walls.Back.Gradient.Visible = true;
			chart3.Walls.Back.Gradient.StartColor = UIColor.Black.CGColor;
			chart3.Walls.Back.Gradient.EndColor = UIColor.FromRGB(79,79,79).CGColor;
			chart3.Axes.Left.Labels.Separation = 100;
			chart3.Axes.Left.Grid.Visible = true;
			chart3.Axes.Left.Grid.Color = UIColor.FromRGB(79,79,79).CGColor;
			chart3.Axes.Bottom.Grid.Color = UIColor.FromRGB(79,79,79).CGColor;
			chart3.Axes.Left.AxisPen.Visible = false;
			
			Steema.TeeChart.Styles.Candle candle = new Steema.TeeChart.Styles.Candle();
			Steema.TeeChart.Styles.Volume volume = new Steema.TeeChart.Styles.Volume();
			
			chart3.Series.Add(candle);
			chart3.Series.Add(volume);
			
			candle.FillSampleValues(70);
			candle.Pen.Visible = false;
			
			volume.FillSampleValues(70);
			volume.Color = UIColor.Yellow.CGColor;
			
			Steema.TeeChart.Axis axis = chart3.Axes.Left;
			//axis.AxisPen.Color = UIColor.Red.CGColor;
			axis.StartPosition = 0;
			axis.EndPosition = 72;
			axis.Labels.Font.Size = 12;
			
			Steema.TeeChart.Axis customAxis = new Steema.TeeChart.Axis(chart3.Chart);
			customAxis.OtherSide = true;
			chart3.Axes.Custom.Add(customAxis);
			//customAxis.AxisPen.Color = UIColor.Blue.CGColor;
			customAxis.StartPosition = 74;
			customAxis.EndPosition = 100;
			customAxis.Labels.Font.Color = UIColor.FromRGB(255,255,240).CGColor;
			customAxis.Labels.Font.Size = 12;
			customAxis.Grid.Visible = false;
			customAxis.AxisPen.Visible = false;
			
			volume.CustomVertAxis = customAxis;
			
			chart3.Legend.Alignment = LegendAlignments.Bottom;
			chart3.Legend.Transparent = true;
			chart3.Legend.Font.Size = 12;
			chart3.Legend.TopLeftPos = 0;
			
			chart3.Axes.Bottom.Labels.Font.Size = 12;

			
			/* Chart 4

			chart4.Aspect.View3D = false;
			chart4.Chart.Aspect.ZoomScrollStyle = Steema.TeeChart.Drawing.Aspect.ZoomScrollStyles.Manual;									
			chart4.Panel.Gradient.Visible = false;
			chart4.Panel.Color = UIColor.Black.CGColor;
			chart4.Walls.Back.Transparent=true;
			Steema.TeeChart.Styles.HorizBar series5 = new Steema.TeeChart.Styles.HorizBar();
			series5.Add(10);
			series5.Add(50);
			series5.Add(30);
			series5.Add(70);
			//series5.BarHeightPercent=100;
			//series5.CustomBarWidth= 80;
			series5.ColorEach = true;
			//series5.Pen.Width = 3;
			//series5.Gradient.Visible = true;
			chart4.Series.Add(series5);
			chart4.Axes.Bottom.Visible = false;
			*/
		}