private void Chart_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e) { Telerik.UI.Xaml.Controls.Chart.RadCartesianChart chart = sender as RadCartesianChart; if (chart != null) { StationLib.StationSocketListener plistener = chart.DataContext as StationLib.StationSocketListener; if (plistener != null) { StationLib.StationSensors SennsorValue = plistener.StationSensors; if (SennsorValue != null) { for (int i = 0; i < chart.Series.Count; i++) { // ScatterLineSeries lineseries = chart.Series[i] as ScatterLineSeries; LineSeries lineseries = chart.Series[i] as LineSeries; if (lineseries != null) { Telerik.UI.Xaml.Controls.Chart.PropertyNameDataPointBinding Ybinding = lineseries.ValueBinding as Telerik.UI.Xaml.Controls.Chart.PropertyNameDataPointBinding; ChartViewType viewType = (ChartViewType)ChartViewCombo.SelectedItem; Ybinding.PropertyName = viewType.ViewPropertyName; //m_MapTemperatureChart.Add(SennsorValue.SensorValues, lineseries); fillChart(SennsorValue.SensorValues, lineseries); m_SensorMaps.Add(new SensorMapToScatterLine(lineseries, SennsorValue.SensorValues)); } } } } } }
public SCChart(object dataSource, ChartViewType viewType, string[] arguments, string[] values, DiagramOptions options = null) : base() { _ViewType = viewType; _ChartOptions = options ?? new DiagramOptions(); _Chart = CreateChart(options); _DataSource = dataSource; _Arguments = arguments; _Values = values; InitializeChart(); }
public SCChart AddSeries(ChartViewType viewType, string name, string argument, string[] values, Series.SeriesOptions options = null) { options ??= new Series.SeriesOptions(); var series = new DevExpress.XtraCharts.Series(name, (ViewType)viewType) { Tag = options }; options.SetupXtraChartSeries(this, series, name, argument, values); CurrentSeries = series; return(this); }
RangeControlClientView Parse(ChartViewType type) { if (type == ChartViewType.Area) { return(new RangeControlClientAreaView()); } if (type == ChartViewType.Bar) { return(new RangeControlClientBarView()); } if (type == ChartViewType.Line) { return(new RangeControlClientLineView()); } return(null); }
private void ChartView_SelectionChanged(object sender, SelectionChangedEventArgs e) { StationLib.StationSocketListener plistener; { ComboBox combo = sender as ComboBox; if (combo == null) { return; } plistener = combo.DataContext as StationLib.StationSocketListener; if (plistener != null) { for (int i = 0; i < m_SensorMaps.Count; i++) { SensorMapToScatterLine map = m_SensorMaps[i]; LineSeries lineseries = map.LineSeries; IObservableVector <StationSensor> SennsorValue = map.Sensors; for (int k = 0; k < plistener.StationSensors.SensorValues.Count; k++) { StationLib.StationSensors sensors = plistener.StationSensors; if (sensors.SensorValues == SennsorValue) { Telerik.UI.Xaml.Controls.Chart.PropertyNameDataPointBinding Ybinding = lineseries.ValueBinding as Telerik.UI.Xaml.Controls.Chart.PropertyNameDataPointBinding; ChartViewType viewType = (ChartViewType)combo.SelectedItem; if (Ybinding.PropertyName != viewType.ViewPropertyName) { Ybinding.PropertyName = viewType.ViewPropertyName; fillChart(SennsorValue, lineseries); } break; } } } } } }
private void insertintoChart(Windows.Foundation.Collections.IObservableVector <StationSensor> SennsorValue, LineSeries lineseries, int Idx) { if (Idx >= SennsorValue.Count) { return; } StationSensor sensor = SennsorValue[Idx]; double YValue = 0; Telerik.UI.Xaml.Controls.Chart.PropertyNameDataPointBinding Ybinding = lineseries.ValueBinding as Telerik.UI.Xaml.Controls.Chart.PropertyNameDataPointBinding; if (Ybinding != null) { if (Ybinding.PropertyName == "Temperature") { YValue = sensor.Temperature; } else if (Ybinding.PropertyName == "FillingLevel") { YValue = sensor.FillingLevel; } else if (Ybinding.PropertyName == "FillingVolume") { YValue = sensor.FillingVolume; } else if (Ybinding.PropertyName == "Pressure") { YValue = sensor.PressurehPaSeaLevel; } else if (Ybinding.PropertyName == "HCSR04MeasTime") { YValue = sensor.HCSR04MeasTime; } else if (Ybinding.PropertyName == "HCSR04MeasTimeDistance") { YValue = sensor.HCSR04MeasTimeDistance; } else if (Ybinding.PropertyName == "Distance") { YValue = sensor.Distance; } else if (Ybinding.PropertyName == "Humidity") { YValue = sensor.Humidity; } else { YValue = 0; } } ChartViewType viewType = (ChartViewType)ChartViewCombo.SelectedItem; if (viewType != null) { viewType.ActValue = YValue; } DateTime dt = FillingLevelApp.Helpers.DateTimeConverter.UnixTimeStampToUTCDateTime(sensor.UnixTime).ToLocalTime(); lineseries.DataPoints.Add(new CategoricalDataPoint() { Category = dt, Value = YValue }); }
public SCChart AddSeries(ChartViewType viewType, string name, string argument, string values, Series.SeriesOptions options = null) => AddSeries(viewType, name, argument, new string[] { values }, options);
public SCChart AddSeries(ChartViewType viewType, string argument, string[] values, Series.SeriesOptions options = null) => AddSeries(viewType, null, argument, values, options);
public SCChart(object dataSource, ChartViewType viewType, string arguments, string values, DiagramOptions options = null) : this(dataSource, viewType, new string[] { arguments }, new string[] { values }, options) { }
public SCChart(object dataSource, ChartViewType viewType, DiagramOptions options = null) : this(dataSource, viewType, (string[])null, (string[])null, options) { }
protected static int GetValuePointCount(ChartViewType viewType) { return(viewType switch { ChartViewType.Bar => 1, ChartViewType.StackedBar => 1, ChartViewType.FullStackedBar => 1, ChartViewType.SideBySideStackedBar => 1, ChartViewType.SideBySideFullStackedBar => 1, ChartViewType.Pie => 1, ChartViewType.Doughnut => 1, ChartViewType.NestedDoughnut => 1, ChartViewType.Funnel => 1, ChartViewType.Point => 1, ChartViewType.Bubble => 2, //Value and Weight ChartViewType.Line => 1, ChartViewType.StackedLine => 1, ChartViewType.FullStackedLine => 1, ChartViewType.StepLine => 1, ChartViewType.Spline => 1, ChartViewType.ScatterLine => 1, ChartViewType.SwiftPlot => 1, ChartViewType.Area => 1, ChartViewType.StepArea => 1, ChartViewType.SplineArea => 1, ChartViewType.StackedArea => 1, ChartViewType.StackedStepArea => 1, ChartViewType.StackedSplineArea => 1, ChartViewType.FullStackedArea => 1, ChartViewType.FullStackedSplineArea => 1, ChartViewType.FullStackedStepArea => 1, ChartViewType.RangeArea => 2, ChartViewType.Stock => 4, //Low, High, Open, Close ChartViewType.CandleStick => 4, //Low, High, Open, Close ChartViewType.SideBySideRangeBar => 2, ChartViewType.RangeBar => 2, ChartViewType.SideBySideGantt => 2, //Date-time values (Start and End) ChartViewType.Gantt => 2, //Date-time values (Start and End) ChartViewType.PolarPoint => 1, ChartViewType.PolarLine => 1, ChartViewType.ScatterPolarLine => 1, ChartViewType.PolarArea => 1, ChartViewType.PolarRangeArea => 2, ChartViewType.RadarPoint => 1, ChartViewType.RadarLine => 1, ChartViewType.ScatterRadarLine => 1, ChartViewType.RadarArea => 1, ChartViewType.RadarRangeArea => 2, ChartViewType.Bar3D => 1, ChartViewType.StackedBar3D => 1, ChartViewType.FullStackedBar3D => 1, ChartViewType.ManhattanBar => 1, ChartViewType.SideBySideStackedBar3D => 1, ChartViewType.SideBySideFullStackedBar3D => 1, ChartViewType.Pie3D => 1, ChartViewType.Doughnut3D => 1, ChartViewType.Funnel3D => 1, ChartViewType.Line3D => 1, ChartViewType.StackedLine3D => 1, ChartViewType.FullStackedLine3D => 1, ChartViewType.StepLine3D => 1, ChartViewType.Area3D => 1, ChartViewType.StackedArea3D => 1, ChartViewType.FullStackedArea3D => 1, ChartViewType.StepArea3D => 1, ChartViewType.Spline3D => 1, ChartViewType.SplineArea3D => 1, ChartViewType.StackedSplineArea3D => 1, ChartViewType.FullStackedSplineArea3D => 1, ChartViewType.RangeArea3D => 2, _ => 1 });