Esempio n. 1
0
        private static void OnSelectionPaletteChanged(DependencyObject target, DependencyPropertyChangedEventArgs args)
        {
            RadChartBase chart = target as RadChartBase;

            chart.selectionPaletteCache = args.NewValue as ChartPalette;
            chart.ProcessPaletteChanged(true);
        }
Esempio n. 2
0
 private static void UpdateSelectionPalette(RadChartBase chart, PredefinedPaletteName paletteName)
 {
     if (chart.GetValue(RadChartBase.SelectionPaletteProperty) == null)
     {
         chart.selectionPaletteCache = ChartPalettes.FromPredefinedName(paletteName);
         chart.ProcessPaletteChanged(true);
     }
 }
Esempio n. 3
0
        internal void Attach(RadChartBase chartBase)
        {
            this.chart             = chartBase;
            this.Element.presenter = this;
            this.OnAttached();

            Canvas.SetZIndex(this, this.DefaultZIndex + this.userZIndex);
        }
Esempio n. 4
0
        private static void OnMinZoomPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            RadChartBase chart = sender as RadChartBase;

            chart.minZoomCache = (Size)e.NewValue;

            chart.UpdateZoom(chart.zoomCache);
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
        internal void AddListener(RadChartBase chart)
        {
            int index = this.charts.IndexOf(chart);

            if (index < 0)
            {
                this.charts.Add(chart);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase" /> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            base.OnDetached(oldChart);

            if (oldChart != null)
            {
                (oldChart.chartArea as ChartAreaModelWithAxes).RemoveAnnotation(this.Model);
            }
        }
Esempio n. 8
0
        internal void Attach(RadChartBase chartBase)
        {
            this.chart = chartBase;
            this.drawWithComposition = this.chart.ContainerVisualsFactory.CanDrawContainerVisual(this);
            this.Element.presenter   = this;
            this.OnAttached();

            Canvas.SetZIndex(this, this.DefaultZIndex + this.userZIndex);
        }
Esempio n. 9
0
        private static void OnZoomPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            RadChartBase chart = sender as RadChartBase;

            if (chart.IsInternalPropertyChange)
            {
                return;
            }

            chart.UpdateZoom((Size)e.NewValue);
        }
Esempio n. 10
0
        private static void OnScrollOffsetPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            RadChartBase chart = sender as RadChartBase;

            if (chart.IsInternalPropertyChange)
            {
                return;
            }

            chart.UpdateScrollOffset((Point)e.NewValue);
        }
Esempio n. 11
0
        private static void OnEmptyContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RadChartBase chart = d as RadChartBase;

            if (chart.IsInternalPropertyChange)
            {
                return;
            }

            chart.userEmptyContent = e.NewValue != null;
        }
Esempio n. 12
0
        internal void Detach()
        {
            RadChartBase oldChart = this.chart;

            this.chart             = null;
            this.Element.presenter = null;
            this.OnDetached(oldChart);

            // invalidate the layout context and isPalette applied flag
            this.InvalidateCore();
        }
Esempio n. 13
0
        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            base.OnDetached(oldChart);

            if (oldChart != null)
            {
                foreach (var item in this.LegendItems)
                {
                    oldChart.LegendInfosInternal.Remove(item);
                }
            }
        }
Esempio n. 14
0
        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase" /> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            base.OnDetached(oldChart);

            if (oldChart != null)
            {
                RadPolarChart chart = oldChart as RadPolarChart;
                this.AxisModel.DetachAxis(chart.PolarAxis.model);
                this.AxisModel.DetachAxis(chart.RadialAxis.model);
            }

            // TODO: Raise exception as needed.
        }
Esempio n. 15
0
        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase" /> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            if (this.horizontalAxisCache != null)
            {
                this.RemoveAxisFromChart(this.horizontalAxisCache, oldChart, false);
            }
            if (this.verticalAxisCache != null)
            {
                this.RemoveAxisFromChart(this.verticalAxisCache, oldChart, false);
            }

            base.OnDetached(oldChart);
        }
Esempio n. 16
0
        private static void OnPaletteChanged(DependencyObject target, DependencyPropertyChangedEventArgs args)
        {
            RadChartBase chart = target as RadChartBase;

            chart.paletteCache = args.NewValue as ChartPalette;

            if (chart.paletteCache == null)
            {
                UpdatePalette(chart, chart.PaletteName);
            }

            chart.ProcessPaletteChanged(true);
        }
Esempio n. 17
0
        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            base.OnDetached(oldChart);

            if (oldChart != null)
            {
                var oldCharArea = oldChart.chartArea as ChartAreaModelWithAxes;
                if (oldCharArea != null)
                {
                    oldCharArea.SetGrid(null);
                }
            }

            // TODO: Consider rasing exception.
        }
Esempio n. 18
0
 private void AddAxisToChart(CartesianAxis axis, RadChartBase chart)
 {
     if (chart == null)
     {
         this.unattachedAxes.Add(axis);
     }
     else
     {
         if (axis.chart == null)
         {
             chart.OnPresenterAdded(axis);
         }
         axis.linkedSeriesCount++;
     }
 }
Esempio n. 19
0
        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            base.OnDetached(oldChart);

            if (oldChart != null)
            {
                var oldChartArea = oldChart.chartArea as ChartAreaModelWithAxes;
                if (oldChartArea != null)
                {
                    oldChartArea.SetGrid(null);
                }
            }

            // TODO: Consider throwing Exception if oldChart is not valid.
        }
Esempio n. 20
0
        // TODO: Check whether we should raise exception if the oldChart is invalid.

        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            this.model.labels.Clear();
            this.model.ticks.Clear();

            base.OnDetached(oldChart);

            if (oldChart != null)
            {
                var oldChartArea = oldChart.chartArea as ChartAreaModelWithAxes;

                if (oldChartArea != null)
                {
                    oldChartArea.RemoveAxis(this.model);
                }
            }
        }
Esempio n. 21
0
        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            base.OnDetached(oldChart);

            if (oldChart != null)
            {
                if (oldChart.chartArea != null && oldChart.chartArea.Series != null)
                {
                    oldChart.chartArea.Series.Remove(this.Model);
                    if (this.labelLayer != null)
                    {
                        oldChart.RemoveLabelLayer(this);
                        this.labelLayer = null;
                    }
                }
                //// TODO: Consider throwing exception if needed.
            }
        }
Esempio n. 22
0
        internal void UpdateSeriesClip()
        {
            if (!this.ClipToPlotArea || !this.IsRendered || !RadChartBase.IsRedstone2())
            {
                return;
            }

            foreach (var path in this.renderSurface.Children.OfType <Path>())
            {
                Point topLeft;
                if (path.Data.Bounds != defaultRect)
                {
                    topLeft = new Point(path.Data.Bounds.X, path.Data.Bounds.Y);
                }
                else
                {
                    topLeft   = path.GetTopLeft();
                    topLeft.X = topLeft.X - this.GetStrokeThicknessAdjustment();
                    topLeft.Y = topLeft.Y - this.GetStrokeThicknessAdjustment();
                }

                TransformGroup transform      = path.RenderTransform as TransformGroup;
                Point          translatePoint = new Point();

                if (transform != null)
                {
                    foreach (var tr in transform.Children)
                    {
                        TranslateTransform translateTransform = tr as TranslateTransform;
                        if (translateTransform != null)
                        {
                            translatePoint.X += translateTransform.X;
                            translatePoint.Y += translateTransform.Y;
                        }
                    }
                }

                path.Clip = new RectangleGeometry()
                {
                    Rect = new Rect(0, 0, this.chart.PlotAreaClip.Width + this.chart.PlotAreaClip.X - topLeft.X - translatePoint.X, this.chart.PlotAreaClip.Height + this.chart.PlotAreaClip.Y - topLeft.Y - translatePoint.Y)
                };
            }
        }
Esempio n. 23
0
        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            base.OnDetached(oldChart);

            if (oldChart != null)
            {
                foreach (Element element in this.Elements)
                {
                    element.presenter = null;
                }

                if (oldChart.chartArea != null && oldChart.chartArea.Series != null)
                {
                    oldChart.chartArea.Series.Remove(this.signalModel);
                }
            }

            // TODO: consider raising exception if oldChart is invalid.
        }
Esempio n. 24
0
        private static void OnSeriesProviderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RadChartBase chart = d as RadChartBase;

            ChartSeriesProvider oldProvider = e.OldValue as ChartSeriesProvider;

            if (oldProvider != null)
            {
                oldProvider.RemoveListener(chart);
            }

            ChartSeriesProvider newProvider = e.NewValue as ChartSeriesProvider;

            if (newProvider != null)
            {
                newProvider.AddListener(chart);
            }

            chart.UpdateDynamicSeries();
        }
Esempio n. 25
0
        private void RemoveAxisFromChart(CartesianAxis axis, RadChartBase chart, bool detachFromSeries)
        {
            if (chart == null)
            {
                this.unattachedAxes.Remove(axis);
            }
            else
            {
                if (axis.linkedSeriesCount == 1)
                {
                    chart.OnPresenterRemoved(axis);
                }
                axis.linkedSeriesCount--;
            }

            if (!detachFromSeries)
            {
                this.unattachedAxes.Add(axis);
            }
        }
Esempio n. 26
0
        /// <summary>
        /// Occurs when the presenter has been successfully detached from its owning <see cref="RadChartBase"/> instance.
        /// </summary>
        protected override void OnDetached(RadChartBase oldChart)
        {
            base.OnDetached(oldChart);

            if (oldChart != null)
            {
                foreach (var element in this.Elements)
                {
                    element.presenter = null;
                }

                if (oldChart.chartArea != null && oldChart.chartArea.Series != null)
                {
                    oldChart.chartArea.Series.Remove(this.lowerBandModel);
                }
            }
            else
            {
                // TODO: consider throwing exception.
            }
        }
Esempio n. 27
0
 internal ChartBehaviorCollection(RadChartBase owner)
 {
     this.owner = owner;
 }
Esempio n. 28
0
 internal PresenterCollection(RadChartBase control)
 {
     this.chart = control;
 }
Esempio n. 29
0
 internal void Attach(RadChartBase owner)
 {
     this.chart = owner;
     this.OnAttached();
 }
Esempio n. 30
0
 internal void Detach()
 {
     this.OnDetached();
     this.chart = null;
 }