public ColorGridChart(ChartView BaseChart)
        {
            colorGrid = new ColorGrid();
            var       = new Variables.Variables();

            BaseChart.Chart.Axes.Left.Automatic               = true;
            BaseChart.Chart.Axes.Bottom.Automatic             = true;
            BaseChart.Chart.Axes.Left.AxisPen.Transparency    = 0;
            BaseChart.Chart.Axes.Left.MinorTicks.Transparency = 0;
            BaseChart.Chart.Legend.Visible = false;
            BaseChart.Chart.Title.Text     = "Color Grid series";

            //Themes.AplicarTheme(BaseChart);

            colorGrid.FillSampleValues(20);

            colorGrid.UseColorRange = true;
            colorGrid.UsePalette    = true;

            colorGrid.StartColor = var.GetPaletteBasic[0];
            colorGrid.MidColor   = var.GetPaletteBasic[1];
            colorGrid.EndColor   = var.GetPaletteBasic[2];
            colorGrid.ColorEach  = true;

            colorGrid.Pen.Color = Color.White;

            //this.colorGrid.Brush.Color = System.Drawing.Color.Red;
            colorGrid.Marks.ArrowLength           = 0;
            colorGrid.Marks.Symbol.Shadow.Height  = 1;
            colorGrid.Marks.Symbol.Shadow.Visible = true;
            colorGrid.Marks.Symbol.Shadow.Width   = 1;
            colorGrid.NumXValues  = 25;
            colorGrid.NumZValues  = 25;
            colorGrid.PaletteMin  = 4;
            colorGrid.PaletteStep = 2;
            colorGrid.Title       = "Color Grid";

            colorGrid.XValues.DataMember = "X";
            colorGrid.YValues.DataMember = "Y";
            colorGrid.ZValues.DataMember = "Z";

            BaseChart.Chart.Series.Add(colorGrid);
        }
Beispiel #2
0
        /// <summary>
        /// Shows the Surface Chart from Pressure Ground Level forecast.
        /// </summary>
        /// <param name="weather"> Weather info</param>
        private void GroundLevelForecast(ActualWeather weather)
        {
            var tChart1 = new Chart();

            tChart1.Axes.Left.Title.Text   = "Hours";
            tChart1.Axes.Bottom.Title.Text = "Days";
            tChart1.Legend.Visible         = false;
            tChart1.Panning.Allow          = ScrollModes.None;
            tChart1.Header.Text            = "Ground Level of " + App.Weather.Name;
            double min = weather.LstWeather[0].GroundLevel;
            double max = weather.LstWeather[0].GroundLevel;

            var groundLevel = new ColorGrid(tChart1);

            groundLevel.FillSampleValues();

            groundLevel.IrregularGrid = true;

            foreach (var item in weather.LstWeather)
            {
                Debug.WriteLine(item.Date.Day + ";" + item.GroundLevel + ";" + item.Date.Hour);
                groundLevel.Add(item.Date.Day, item.GroundLevel, item.Date.Hour);
            }

            groundLevel.StartColor = Color.FromHex("#F2B551");
            groundLevel.EndColor   = Color.FromHex("#ED8256");
            groundLevel.MidColor   = Color.FromHex("#ED8256");
            //tChart1.AfterDraw += new PaintChartEventHandler(this.tChart1_AfterDraw);
            groundLevel.Marks.Visible = false;

            AxisSettings(tChart1);
            TitleSettings(tChart1);
            SeriesMarksSettings(groundLevel);

            ShowChart(tChart1);
        }