예제 #1
0
 private void BtnPreview_DayOfWeek_Click(object sender, EventArgs e)
 {
     Tchart_DayOfWeek.Show();
     Tchart_Period.Hide();
     if (DayOfWeekConf.Channel != null && DayOfWeekConf.Channel.BandpassArr.Where(x => x.Active).Count() > 0)
     {
         Tchart_DayOfWeek.Axes.Bottom.AutomaticMaximum = DayOfWeekConf.AutoScale;
         if (!DayOfWeekConf.AutoScale)
         {
             Tchart_DayOfWeek.Axes.Bottom.Maximum = DayOfWeekConf.MaxScale;
         }
         Tchart_DayOfWeek.Series.Clear();
         Tchart_DayOfWeek.Header.Lines = new string[] { DayOfWeekConf.Channel.BandpassArr.Where(x => x.Active).First().OverrideInfo.OverrideName };
         var datas = DBConn.LoadDayOfWeekData(DayOfWeekConf);
         Tchart_DayOfWeek.Legend.Visible = (datas.Count != 1) ? true : false;
         Tchart_DayOfWeek.Header.Visible = (datas.Count != 1) ? false : true;
         foreach (var dataTable in datas)
         {
             HorizBar hBar = new HorizBar()
             {
                 Title = dataTable.TableName, ColorEach = (datas.Count == 1)? true:false
             };
             hBar.Marks.Visible = false;
             Tchart_DayOfWeek.Series.Add(hBar);
             foreach (DataRow data in dataTable.Rows)
             {
                 hBar.Add(Convert.ToDouble(data.ItemArray[1]), data.ItemArray[0].ToString());
             }
         }
     }
 }
        private void HumidityForecast(ActualWeather weather)
        {
            Chart tChart1 = new Chart();

            tChart1.Axes.Bottom.Ticks.Visible     = false;
            tChart1.Axes.Bottom.Labels.Visible    = false;
            tChart1.Axes.Bottom.Labels.Font.Color = Color.White;
            tChart1.Axes.Left.Increment           = Utils.GetDateTimeStep(DateTimeSteps.OneDay);
            tChart1.Axes.Left.Labels.Font.Size    = 15;
            tChart1.Axes.Left.Labels.Font.Color   = Color.White;
            tChart1.Header.Visible              = false;
            tChart1.Panel.Visible               = true;
            tChart1.Panel.Transparent           = false;
            tChart1.Panel.Gradient.Visible      = false;
            tChart1.Panel.Color                 = Color.FromHex("#125675");
            tChart1.Header.Alignment            = TextAlignment.Center;
            tChart1.Walls.Back.Visible          = true;
            tChart1.Walls.Back.Transparent      = false;
            tChart1.Walls.Back.Gradient.Visible = false;
            tChart1.Panel.MarginBottom          = 5;
            tChart1.Panel.MarginLeft            = 5;
            tChart1.Panel.MarginRight           = 5;
            tChart1.Panel.MarginTop             = 5;
            tChart1.Walls.Back.Color            = Color.White;
            tChart1.Zoom.Active                 = true;
            tChart1.Aspect.View3D               = false;
            tChart1.Legend.Visible              = false;

            var humidity = new HorizBar(tChart1.Chart);

            humidity.Marks.AutoPosition = true;
            humidity.Marks.Transparent  = true;
            humidity.MarksLocation      = MarksLocation.End;
            humidity.Marks.Font.Size    = 10;
            humidity.Marks.Style        = MarksStyles.Value;


            double max = weather.LstWeather[0].Humidity;

            foreach (var item in weather.LstWeather)
            {
                if (item.Humidity > max)
                {
                    max = item.Humidity;
                }
                humidity.Add(item.Humidity, item.Date);
            }

            tChart1.Legend.Visible = false;
            tChart1.Axes.Bottom.SetMinMax(0, max + 20);
            humidity.Color = Color.FromHex("#85D2F6");
            ShowChart(tChart1);
        }
예제 #3
0
        /// <summary>
        /// Shows the HorizontalBar Chart from Humidity forecast.
        /// </summary>
        /// <param name="weather"> Weather info</param>
        private void HumidityForecast(ActualWeather weather)
        {
            var tChart1 = new Chart();

            tChart1.Axes.Left.Increment = Steema.TeeChart.Utils.GetDateTimeStep(DateTimeSteps.OneDay);
            tChart1.Aspect.View3D       = false;
            tChart1.Legend.Visible      = false;
            tChart1.Header.Text         = "Humidity of " + App.Weather.Name;

            var humidity = new HorizBar(tChart1);

            humidity.Marks.AutoPosition = true;
            humidity.Marks.Transparent  = true;
            humidity.MarksLocation      = MarksLocation.End;
            humidity.Marks.Font.Size    = 11;
            humidity.Marks.Style        = MarksStyles.Value;
            humidity.Marks.Arrow.Color  = Color.Transparent;
            humidity.Marks.DrawEvery    = 2;

            double max = weather.LstWeather[0].Humidity;

            foreach (var item in weather.LstWeather)
            {
                if (item.Humidity > max)
                {
                    max = item.Humidity;
                }
                humidity.Add(item.Humidity, item.Date);
            }

            tChart1.Legend.Visible = false;
            tChart1.Axes.Bottom.SetMinMax(0, max + 20);
            humidity.Color = Color.FromRgb(27, 177, 255);

            AxisSettings(tChart1);
            TitleSettings(tChart1);
            tChart1.Header.Visible = true;

            ShowChart(tChart1);
        }
예제 #4
0
        private void InitializeChart()
        {
            this.tChart1.Aspect.GestureOptions = Aspect.Gestures.None;
            this.tChart2.Aspect.GestureOptions = Aspect.Gestures.None;
            this.tChart3.Aspect.GestureOptions = Aspect.Gestures.None;

            calendar1.NextMonthButton.Visible     = false;
            calendar1.PreviousMonthButton.Visible = false;

            this.tChart1.Aspect.ColorPaletteIndex = 21;
            this.tChart1.Aspect.View3D            = false;
            this.tChart1.Axes.Visible             = false;
            this.tChart1.Header.AdjustFrame       = false;
            this.tChart1.Header.Brush.Color       = Color.FromArgb(255, ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            this.tChart1.Header.Font.Brush.Color  = Colors.Gray;
            this.tChart1.Header.Font.Name         = "Segoe UI";
            this.tChart1.Header.Font.Size         = 18;
            this.tChart1.Header.Lines             = new string[] {
                "Server Status"
            };
            this.tChart1.Header.Pen.Color             = Color.FromArgb(255, ((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
            this.tChart1.Header.Transparent           = false;
            this.tChart1.Legend.Visible               = false;
            this.tChart1.Panel.Brush.Color            = Color.FromArgb(255, ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            this.tChart1.Panel.Brush.Gradient.Visible = false;
            this.tChart1.Series.Add(this.horizBar1);
            this.tChart1.Series.Add(this.horizBar2);
            this.tChart1.TabIndex      = 0;
            this.tChart1.Walls.Visible = false;
            this.tChart1.AfterDraw    += TChart1_AfterDraw;
            this.horizBar1.BarRound    = BarRounding.AtValue;
            this.horizBar1.BarStyle    = BarStyles.RoundRectangle;
            this.horizBar1.Brush.Color = Color.FromArgb(255, ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            this.horizBar1.Brush.Gradient.Direction = Steema.TeeChart.Store.Drawing.GradientDirection.BottomTop;
            this.horizBar1.Color                    = Color.FromArgb(255, ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            this.horizBar1.ColorEach                = false;
            this.horizBar1.Marks.Visible            = false;
            this.horizBar1.MultiBar                 = MultiBars.None;
            this.horizBar1.OriginalCursor           = null;
            this.horizBar1.Pen.Color                = Color.FromArgb(255, ((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
            this.horizBar1.Title                    = "horizBar1";
            this.horizBar1.XValues.DataMember       = "X";
            this.horizBar1.YValues.DataMember       = "Bar";
            this.horizBar1.YValues.Order            = ValueListOrder.Ascending;
            this.horizBar2.BarRound                 = BarRounding.AtValue;
            this.horizBar2.BarStyle                 = BarStyles.RoundRectangle;
            this.horizBar2.Brush.Color              = Color.FromArgb(255, ((int)(((byte)(243)))), ((int)(((byte)(156)))), ((int)(((byte)(53)))));
            this.horizBar2.Brush.Gradient.Direction = Steema.TeeChart.Store.Drawing.GradientDirection.BottomTop;
            this.horizBar2.Color                    = Color.FromArgb(255, ((int)(((byte)(243)))), ((int)(((byte)(156)))), ((int)(((byte)(53)))));
            this.horizBar2.ColorEach                = true;
            this.horizBar2.Marks.Arrow.Visible      = false;
            this.horizBar2.Marks.ArrowLength        = -34;
            this.horizBar2.Marks.Brush.Visible      = false;
            this.horizBar2.Marks.Font.Bold          = true;
            this.horizBar2.Marks.Font.Brush.Color   = Color.FromArgb(255, ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            this.horizBar2.Marks.Style              = MarksStyles.Percent;
            this.horizBar2.Marks.Transparent        = true;
            this.horizBar2.MultiBar                 = MultiBars.None;
            this.horizBar2.OriginalCursor           = null;
            this.horizBar2.Pen.Color                = Color.FromArgb(255, ((int)(((byte)(146)))), ((int)(((byte)(94)))), ((int)(((byte)(32)))));
            this.horizBar2.Title                    = "horizBar2";
            this.horizBar2.YValues.Order            = ValueListOrder.Ascending;
            this.tChart2.Aspect.ColorPaletteIndex   = 21;
            this.tChart2.Footer.Font.Brush.Color    = Colors.Blue;
            this.tChart2.Header.Visible             = false;
            this.tChart2.Legend.Visible             = false;
            this.tChart2.Name = "tChart2";
            this.tChart2.Panel.Bevel.Outer             = BevelStyles.None;
            this.tChart2.Panel.Brush.Color             = Colors.White;
            this.tChart2.Panel.Brush.Gradient.EndColor = Colors.White;
            this.tChart2.Series.Add(this.calendar1);
            this.tChart2.TabIndex = 1;
            this.tChart2.Walls.Back.Brush.Gradient.EndColor = Colors.White;
            this.calendar1.Color                             = Utils.EmptyColor;
            this.calendar1.ColorEach                         = false;
            this.calendar1.ColorMember                       = "Colors";
            this.calendar1.Date                              = new System.DateTime(2015, 3, 9, 0, 0, 0, 0);
            this.calendar1.DayOneColumn                      = 7;
            this.calendar1.DayOneRow                         = 3;
            this.calendar1.Legend.Visible                    = false;
            this.calendar1.Marks.Brush.Color                 = Colors.Gold;
            this.calendar1.OriginalCursor                    = null;
            this.calendar1.Pen.Visible                       = false;
            this.calendar1.Title                             = "calendar1";
            this.calendar1.XValues.DataMember                = "X";
            this.calendar1.XValues.Order                     = ValueListOrder.Ascending;
            this.calendar1.YValues.DataMember                = "Y";
            this.calendar1.Change                           += Calendar1_Change;
            this.tChart3.Aspect.ColorPaletteIndex            = 21;
            this.tChart3.Aspect.View3D                       = false;
            this.tChart3.Axes.Bottom.AxisPen.Width           = 1;
            this.tChart3.Axes.Bottom.Labels.Font.Brush.Color = Colors.Gray;
            this.tChart3.Axes.Bottom.Labels.Font.Name        = "Segoe UI";
            this.tChart3.Axes.Left.AxisPen.Visible           = false;
            this.tChart3.Axes.Left.Grid.Visible              = false;
            this.tChart3.Axes.Left.Labels.Font.Brush.Color   = Colors.Gray;
            this.tChart3.Axes.Left.Labels.Font.Name          = "Segoe UI";
            this.tChart3.Axes.Left.MinorTicks.Visible        = false;
            this.tChart3.Axes.Left.Ticks.Color               = Color.FromArgb(255, ((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
            this.tChart3.Footer.Font.Brush.Color             = Colors.Blue;
            this.tChart3.Header.Alignment                    = TextAlignment.Left;
            this.tChart3.Header.Font.Brush.Color             = Colors.Gray;
            this.tChart3.Header.Font.Size                    = 16;
            this.tChart3.Header.Lines                        = new string[] {
                "Active Servers"
            };
            this.tChart3.Legend.Alignment   = LegendAlignments.Bottom;
            this.tChart3.Legend.Transparent = true;
            this.tChart3.Name = "tChart3";
            this.tChart3.Panel.Bevel.Outer             = BevelStyles.None;
            this.tChart3.Panel.Brush.Color             = Color.FromArgb(255, ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
            this.tChart3.Panel.Brush.Gradient.EndColor = Colors.White;
            this.tChart3.Panel.Brush.Gradient.Visible  = false;
            this.tChart3.Panel.MarginBottom            = 1D;
            this.tChart3.Panel.MarginLeft  = 2D;
            this.tChart3.Panel.MarginRight = 2D;
            this.tChart3.Panel.MarginTop   = 2D;
            this.tChart3.Series.Add(this.horizBar3);
            this.tChart3.Series.Add(this.horizBar4);
            this.tChart3.Series.Add(this.horizBar5);
            this.tChart3.TabIndex = 0;
            this.tChart3.Walls.Back.Brush.Gradient.EndColor = Colors.White;
            this.tChart3.Walls.Back.Visible         = false;
            this.horizBar3.BarRound                 = BarRounding.AtValue;
            this.horizBar3.RoundSize                = 2;
            this.horizBar3.BarStyle                 = BarStyles.RoundRectangle;
            this.horizBar3.Brush.Color              = Color.FromArgb(255, ((int)(((byte)(220)))), ((int)(((byte)(92)))), ((int)(((byte)(5)))));
            this.horizBar3.Brush.Gradient.Direction = Steema.TeeChart.Store.Drawing.GradientDirection.BottomTop;
            this.horizBar3.Color                    = Color.FromArgb(255, ((int)(((byte)(220)))), ((int)(((byte)(92)))), ((int)(((byte)(5)))));
            this.horizBar3.ColorEach                = false;
            this.horizBar3.Marks.Visible            = false;
            this.horizBar3.OriginalCursor           = null;
            this.horizBar3.Pen.Color                = Color.FromArgb(255, ((int)(((byte)(132)))), ((int)(((byte)(55)))), ((int)(((byte)(3)))));
            this.horizBar3.Title                    = "Server 1";
            this.horizBar3.XValues.DataMember       = "X";
            this.horizBar3.YValues.DataMember       = "Bar";
            this.horizBar3.YValues.Order            = ValueListOrder.Ascending;
            this.horizBar4.BarRound                 = BarRounding.AtValue;
            this.horizBar4.BarStyle                 = BarStyles.RoundRectangle;
            this.horizBar4.RoundSize                = 2;
            this.horizBar4.Brush.Color              = Color.FromArgb(255, ((int)(((byte)(255)))), ((int)(((byte)(172)))), ((int)(((byte)(0)))));
            this.horizBar4.Brush.Gradient.Direction = Steema.TeeChart.Store.Drawing.GradientDirection.BottomTop;
            this.horizBar4.Color                    = Color.FromArgb(255, ((int)(((byte)(255)))), ((int)(((byte)(172)))), ((int)(((byte)(0)))));
            this.horizBar4.ColorEach                = false;
            this.horizBar4.Marks.Visible            = false;
            this.horizBar4.OriginalCursor           = null;
            this.horizBar4.Pen.Color                = Color.FromArgb(255, ((int)(((byte)(153)))), ((int)(((byte)(103)))), ((int)(((byte)(0)))));
            this.horizBar4.Title                    = "Server 2";
            this.horizBar4.XValues.DataMember       = "X";
            this.horizBar4.YValues.DataMember       = "Bar";
            this.horizBar4.YValues.Order            = ValueListOrder.Ascending;
            this.horizBar5.BarRound                 = BarRounding.AtValue;
            this.horizBar5.BarStyle                 = BarStyles.RoundRectangle;
            this.horizBar5.RoundSize                = 2;
            this.horizBar5.Brush.Color              = Color.FromArgb(255, ((int)(((byte)(110)))), ((int)(((byte)(197)))), ((int)(((byte)(184)))));
            this.horizBar5.Brush.Gradient.Direction = Steema.TeeChart.Store.Drawing.GradientDirection.BottomTop;
            this.horizBar5.Color                    = Color.FromArgb(255, ((int)(((byte)(110)))), ((int)(((byte)(197)))), ((int)(((byte)(184)))));
            this.horizBar5.ColorEach                = false;
            this.horizBar5.Marks.Visible            = false;
            this.horizBar5.OriginalCursor           = null;
            this.horizBar5.Pen.Color                = Color.FromArgb(255, ((int)(((byte)(66)))), ((int)(((byte)(118)))), ((int)(((byte)(110)))));
            this.horizBar5.Title                    = "Server 3";
            this.horizBar5.XValues.DataMember       = "X";
            this.horizBar5.YValues.Order            = ValueListOrder.Ascending;


            tChart1.Panel.Gradient.Visible = false;
            tChart2.Panel.Gradient.Visible = false;
            tChart3.Panel.Gradient.Visible = false;

            double[] h1Vals = new double[] { 100, 100, 100, 100, 100 };
            horizBar1.Add(h1Vals);
            double[] h2Vals = new double[] { 60, 85, 40, 55, 50 };
            horizBar2.Add(h2Vals);

            horizBar3.FillSampleValues(3);
            horizBar4.FillSampleValues(3);
            horizBar5.FillSampleValues(3);
            horizBar3.Labels[0] = "Speed";
            horizBar3.Labels[1] = "Time";
            horizBar3.Labels[2] = "Visitors";

            calendar1.FillSampleValues();
            calendar1.Date              = DateTime.Now;
            calendar1.Today.Color       = LookoutTheme.SeawashPalette[9];
            calendar1.Sunday.Color      = LookoutTheme.SeawashPalette[10];
            calendar1.Sunday.Font.Color = Colors.Black;
        }
예제 #5
0
        public HorizontalBarChart(ChartView BaseChart)
        {
            bar1           = new HorizBar();
            var            = new Variables.Variables();
            this.BaseChart = BaseChart;

            BaseChart.Chart.Legend.Visible = true;
            BaseChart.Chart.Header.Text    = "Number of Museum Visitors (2008-2011)";
            BaseChart.Chart.Series.Add(bar1);
            //BaseChart.Chart.Series.Add(bar2);

            bar1.Colors = new ColorList {
                var.GetPaletteBasic[0]
            };
            bar1.SeriesColor         = var.GetPaletteBasic[0];
            bar1.Chart.Zoom.Allow    = false;
            bar1.Chart.Panning.Allow = ScrollModes.None;
            bar1.RecalcOptions       = RecalcOptions.OnModify;
            bar1.Title            = "National Gallery";
            bar1.DefaultNullValue = 0;
            for (int i = 0; i < var.GetValorHorizBar1.Length; i++)
            {
                bar1.Add(var.GetValorHorizBar1[i], var.GetValorHorizBarX[i]);
            }
            bar1.MarksOnBar  = true;
            bar1.Marks.Style = MarksStyles.Value;
            bar1.VertAxis    = VerticalAxis.Both;
            bar1.HorizAxis   = HorizontalAxis.Both;

            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue, BaseChart.Chart.Axes.Left.MaxYValue);
            BaseChart.Chart.Axes.Bottom.SetMinMax(BaseChart.Chart.Axes.Bottom.MinXValue, BaseChart.Chart.Axes.Bottom.MaxXValue);
            BaseChart.Chart.Axes.Left.Title.Visible        = false;
            BaseChart.Chart.Axes.Bottom.Title.Text         = "Annual Visitors (M)";
            BaseChart.Chart.Axes.Left.Visible              = false;
            BaseChart.Chart.Axes.Bottom.Labels.ValueFormat = "0";
            BaseChart.Chart.Axes.Left.Labels.ValueFormat   = "0";
            BaseChart.Chart.Axes.Bottom.Increment          = 1;
            BaseChart.Chart.Axes.Left.Increment            = 1;
            BaseChart.Chart.Axes.Bottom.Grid.Visible       = true;
            BaseChart.Chart.Legend.Visible     = true;
            BaseChart.Chart.Legend.LegendStyle = LegendStyles.Series;
            BaseChart.Chart.ClickSeries       += null;
            BaseChart.Chart.Axes.Left.Ticks    = new Axis.TicksPen {
                Width = 2, Visible = true, Color = Color.White, EndCap = PenLineCap.Flat, Style = DashStyle.Solid, Length = 10,
            };
            BaseChart.Chart.Axes.Left.Visible         = true;
            BaseChart.Chart.Axes.Left.Labels.Visible  = true;
            BaseChart.Chart.Axes.Bottom.Title.Visible = true;
            BaseChart.Chart.Axes.Left.Labels.Angle    = 0;

            BaseChart.Chart.Axes.Left.AxisPen.Visible = true;
            BaseChart.Chart.Axes.Left.Grid.Visible    = false;
            BaseChart.Chart.Axes.Bottom.Grid.Visible  = false;
            BaseChart.Chart.Panel.MarginLeft          = 5;

            // Themes Marks
            Themes.AplicarMarksTheme1(BaseChart);

            BaseChart.Chart.Series[0].Marks.Font.Size = 14;

            bar1.Marks.Pen.Visible = false;


            BaseChart.Chart.Series[0].Marks.TextAlign = TextAlignment.Center;
            BaseChart.Chart.Series[0].Marks.AutoSize  = true;
            BaseChart.Chart.Series[0].Marks.Color     = Color.Transparent;

            BaseChart.Chart.ClickSeries += null;
        }