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); }
/// <summary> /// /// </summary> /// <param name="horizBarSeries"></param> /// <param name="Yaxis"></param> /// <param name="seriesName"></param> public static void InitHorizBarSeries(HorizBar horizBarSeries, VerticalAxis Yaxis, string seriesName) { // Axis 관련 항목 horizBarSeries.BarStyle = Steema.TeeChart.Styles.BarStyles.Cylinder; horizBarSeries.Pen.Visible = false; horizBarSeries.ColorEach = true; horizBarSeries.VertAxis = Yaxis; horizBarSeries.XValues.DateTime = false; horizBarSeries.Title = seriesName; horizBarSeries.Marks.Visible = false; }
public HorizBar AddHorizBarSeries(TChart objChart, string p_SeriesName, VerticalAxis p_VertAxis, Color p_seriesColor, bool p_EachColor, bool p_showInLegend) { Steema.TeeChart.Styles.HorizBar horizBar = new HorizBar(); objChart.Series.Add(horizBar); horizBar.VertAxis = p_VertAxis; horizBar.BarStyle = Steema.TeeChart.Styles.BarStyles.Cylinder; horizBar.Pen.Visible = false; horizBar.Color = p_seriesColor; horizBar.ColorEach = p_EachColor; horizBar.Marks.Visible = false; horizBar.Title = p_SeriesName; return(horizBar); }
/// <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); }
private void ChartToCreate(String item) { List <String[]> originalData = ChartData(); String[] dataPicker = new String[originalData.Count]; for (int i = 0; i < originalData.Count; i++) { dataPicker[i] = originalData[i][1]; } _customChart.ChartView.Chart.Series.RemoveAllSeries(); var imageButton = ((((this.Children[0] as ContentPage).Content as ScrollView).Content as StackLayout).Children[1] as Grid).Children[2] as Button; switch (item) { case "AREA": Area area = new Area(); area.FillSampleValues(3); _customChart.ChartView.Chart.Series.Add(area); _customChart.ImageSource = dataPicker[0]; imageButton.ImageSource = dataPicker[0]; break; #if !TEE_STD case "ARROW": Arrow arrow = new Arrow(); arrow.FillSampleValues(10); _customChart.ChartView.Chart.Series.Add(arrow); _customChart.ImageSource = dataPicker[1]; imageButton.ImageSource = dataPicker[1]; break; #endif case "BAR": Bar bar = new Bar(); bar.FillSampleValues(4); _customChart.ChartView.Chart.Series.Add(bar); _customChart.ImageSource = dataPicker[2]; imageButton.ImageSource = dataPicker[2]; break; #if !TEE_STD case "BARJOIN": BarJoin barjoin = new BarJoin(); barjoin.FillSampleValues(5); _customChart.ChartView.Chart.Series.Add(barjoin); _customChart.ImageSource = dataPicker[3]; imageButton.ImageSource = dataPicker[3]; break; case "BEZIER": Bezier bezier = new Bezier(); bezier.FillSampleValues(5); _customChart.ChartView.Chart.Series.Add(bezier); _customChart.ImageSource = dataPicker[4]; imageButton.ImageSource = dataPicker[4]; break; case "BOX": Box box = new Box(); box.FillSampleValues(3); _customChart.ChartView.Chart.Series.Add(box); _customChart.ImageSource = dataPicker[5]; imageButton.ImageSource = dataPicker[5]; break; #endif case "BUBBLES": Bubble bubble = new Bubble(); bubble.FillSampleValues(7); _customChart.ChartView.Chart.Series.Add(bubble); _customChart.ImageSource = dataPicker[6]; imageButton.ImageSource = dataPicker[6]; break; #if !TEE_STD case "CANDLE": Candle candle = new Candle(); candle.FillSampleValues(5); _customChart.ChartView.Chart.Series.Add(candle); _customChart.ImageSource = dataPicker[7]; imageButton.ImageSource = dataPicker[7]; break; case "CONTOUR": Contour countour = new Contour(); countour.FillSampleValues(1); _customChart.ChartView.Chart.Series.Add(countour); _customChart.ImageSource = dataPicker[8]; imageButton.ImageSource = dataPicker[8]; break; case "DARVAS": Darvas darvas = new Darvas(); darvas.FillSampleValues(3); _customChart.ChartView.Chart.Series.Add(darvas); _customChart.ImageSource = dataPicker[9]; imageButton.ImageSource = dataPicker[9]; break; #endif case "DONUT": Donut donut = new Donut(); donut.FillSampleValues(1); _customChart.ChartView.Chart.Series.Add(donut); _customChart.ImageSource = dataPicker[10]; imageButton.ImageSource = dataPicker[10]; break; #if !TEE_STD case "ERROR": Error error = new Error(); error.FillSampleValues(5); _customChart.ChartView.Chart.Series.Add(error); _customChart.ImageSource = dataPicker[11]; imageButton.ImageSource = dataPicker[11]; break; case "ERRORBAR": ErrorBar errorbar = new ErrorBar(); errorbar.FillSampleValues(5); _customChart.ChartView.Chart.Series.Add(errorbar); _customChart.ImageSource = dataPicker[12]; imageButton.ImageSource = dataPicker[12]; break; case "ERRORPOINT": ErrorPoint errorPoint = new ErrorPoint(); errorPoint.FillSampleValues(7); _customChart.ChartView.Chart.Series.Add(errorPoint); _customChart.ImageSource = dataPicker[13]; imageButton.ImageSource = dataPicker[13]; break; #endif case "FASTLINE": FastLine fastLine = new FastLine(); fastLine.FillSampleValues(2); _customChart.ChartView.Chart.Series.Add(fastLine); _customChart.ImageSource = dataPicker[14]; imageButton.ImageSource = dataPicker[14]; break; #if !TEE_STD case "HIGHLOW": HighLow highLow = new HighLow(); highLow.FillSampleValues(4); _customChart.ChartView.Chart.Series.Add(highLow); _customChart.ImageSource = dataPicker[15]; imageButton.ImageSource = dataPicker[15]; break; case "HISTOGRAM": Histogram histogram = new Histogram(); histogram.FillSampleValues(6); _customChart.ChartView.Chart.Series.Add(histogram); _customChart.ImageSource = dataPicker[16]; imageButton.ImageSource = dataPicker[16]; break; #endif case "HORIZAREA": HorizArea horizArea = new HorizArea(); horizArea.FillSampleValues(6); _customChart.ChartView.Chart.Series.Add(horizArea); _customChart.ImageSource = dataPicker[17]; imageButton.ImageSource = dataPicker[17]; break; case "HORIZBAR": HorizBar horizBar = new HorizBar(); horizBar.FillSampleValues(6); _customChart.ChartView.Chart.Series.Add(horizBar); _customChart.ImageSource = dataPicker[18]; imageButton.ImageSource = dataPicker[18]; break; case "HORIZLINE": HorizLine horizLine = new HorizLine(); horizLine.FillSampleValues(6); _customChart.ChartView.Chart.Series.Add(horizLine); _customChart.ImageSource = dataPicker[19]; imageButton.ImageSource = dataPicker[19]; break; #if !TEE_STD case "ISOSURFACE": IsoSurface isoSurface = new IsoSurface(); isoSurface.FillSampleValues(10); _customChart.ChartView.Chart.Series.Add(isoSurface); _customChart.ImageSource = dataPicker[20]; imageButton.ImageSource = dataPicker[20]; break; #endif case "LINE": Line line = new Line(); line.FillSampleValues(5); _customChart.ChartView.Chart.Series.Add(line); _customChart.ImageSource = dataPicker[21]; imageButton.ImageSource = dataPicker[21]; break; #if !TEE_STD case "LINEPOINT": LinePoint linePoint = new LinePoint(); linePoint.FillSampleValues(6); _customChart.ChartView.Chart.Series.Add(linePoint); _customChart.ImageSource = dataPicker[22]; imageButton.ImageSource = dataPicker[22]; break; #endif case "PIE": Pie pie = new Pie(); pie.FillSampleValues(4); _customChart.ChartView.Chart.Series.Add(pie); _customChart.ImageSource = dataPicker[23]; imageButton.ImageSource = dataPicker[23]; break; #if !TEE_STD case "SURFACE": Surface surface = new Surface(); surface.FillSampleValues(10); //surface. _customChart.ChartView.Chart.Series.Add(surface); _customChart.ImageSource = dataPicker[24]; imageButton.ImageSource = dataPicker[24]; break; case "TOWER": Tower tower = new Tower(); tower.FillSampleValues(8); _customChart.ChartView.Chart.Series.Add(tower); _customChart.ImageSource = dataPicker[25]; imageButton.ImageSource = dataPicker[25]; break; case "VOLUME": Volume volume = new Volume(); volume.FillSampleValues(9); _customChart.ChartView.Chart.Series.Add(volume); _customChart.ImageSource = dataPicker[26]; imageButton.ImageSource = dataPicker[26]; break; #endif } _customChart.ChartView.Chart.Axes.Left.Automatic = true; _customChart.ChartView.Chart.Axes.Bottom.Automatic = true; }
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; }