Ejemplo n.º 1
0
 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));
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        private void OnAxisChanged(CartesianAxis oldAxis, CartesianAxis newAxis)
        {
            if (oldAxis != null)
            {
                this.RemoveAxisFromChart(oldAxis, this.chart, true);
                this.AxisModel.DetachAxis(oldAxis.model);
            }

            if (newAxis != null)
            {
                this.AddAxisToChart(newAxis, this.chart);
                this.AxisModel.AttachAxis(newAxis.model, newAxis.type);
            }

            if (oldAxis != null && newAxis == null)
            {
                RadCartesianChart cartesianChart = this.chart as RadCartesianChart;
                if (cartesianChart != null)
                {
                    if (oldAxis.type == AxisType.First && cartesianChart.HorizontalAxis != null)
                    {
                        this.AxisModel.AttachAxis(cartesianChart.HorizontalAxis.model, AxisType.First);
                    }
                    else if (oldAxis.type == AxisType.Second && cartesianChart.VerticalAxis != null)
                    {
                        this.AxisModel.AttachAxis(cartesianChart.VerticalAxis.model, AxisType.Second);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase" /> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            RadCartesianChart chart = oldChart as RadCartesianChart;

            this.model.DetachAxis(chart.HorizontalAxis.model);
            this.model.DetachAxis(chart.VerticalAxis.model);

            base.OnDetached(oldChart);
        }
Ejemplo n.º 4
0
        private static void OnVerticalAxisChanged(DependencyObject target, DependencyPropertyChangedEventArgs args)
        {
            RadCartesianChart chart   = target as RadCartesianChart;
            CartesianAxis     oldAxis = args.OldValue as CartesianAxis;
            CartesianAxis     newAxis = args.NewValue as CartesianAxis;

            chart.verticalAxisCache = newAxis;
            if (chart.verticalAxisCache != null)
            {
                chart.verticalAxisCache.type = AxisType.Second;
            }

            chart.OnAxisChanged(oldAxis, newAxis);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Occurs when the presenter has been successfully attached to its owning <see cref="RadChartBase" /> instance.
        /// </summary>
        protected override void OnAttached()
        {
            RadCartesianChart chart = this.chart as RadCartesianChart;

            if (chart.HorizontalAxis != null)
            {
                this.model.AttachAxis(chart.HorizontalAxis.model, AxisType.First);
            }
            if (chart.VerticalAxis != null)
            {
                this.model.AttachAxis(chart.VerticalAxis.model, AxisType.Second);
            }

            base.OnAttached();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Occurs when the presenter has been successfully attached to its owning <see cref="RadChartBase" /> instance.
        /// </summary>
        protected override void OnAttached()
        {
            base.OnAttached();

            RadCartesianChart cartesianChart = this.chart as RadCartesianChart;

            if (this.HorizontalAxis == null && cartesianChart.HorizontalAxis != null)
            {
                this.model.FirstAxis = cartesianChart.HorizontalAxis.model;
            }
            if (this.VerticalAxis == null && cartesianChart.VerticalAxis != null)
            {
                this.model.SecondAxis = cartesianChart.VerticalAxis.model;
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Occurs when the presenter has been successfully attached to its owning <see cref="RadChartBase" /> instance.
        /// </summary>
        protected override void OnAttached()
        {
            foreach (CartesianAxis axis in this.unattachedAxes)
            {
                this.AddAxisToChart(axis, this.chart);
            }
            this.unattachedAxes.Clear();

            RadCartesianChart cartesianChart = this.chart as RadCartesianChart;

            if (this.horizontalAxisCache == null && cartesianChart.HorizontalAxis != null)
            {
                this.AxisModel.AttachAxis(cartesianChart.HorizontalAxis.model, AxisType.First);
            }
            if (this.verticalAxisCache == null && cartesianChart.VerticalAxis != null)
            {
                this.AxisModel.AttachAxis(cartesianChart.VerticalAxis.model, AxisType.Second);
            }

            base.OnAttached();
        }