private void InitChart(SCIChartSurface surface, BasePaneModel model, bool isMainPain)
        {
            _axisAreaSizeSync.AttachSurface(surface);

            var xAxis = new SCICategoryDateTimeAxis {
                IsVisible = isMainPain, GrowBy = new SCIDoubleRange(0, 0.05)
            };

            _axisRangeSync.AttachAxis(xAxis);

            using (surface.SuspendUpdates())
            {
                surface.XAxes.Add(xAxis);
                surface.YAxes.Add(model.YAxis);
                surface.RenderableSeries = model.RenderableSeries;
                surface.Annotations      = model.Annotations;

                surface.ChartModifiers = new SCIChartModifierCollection
                {
                    new SCIXAxisDragModifier {
                        DragMode = SCIAxisDragMode.Pan, ClipModeX = SCIClipMode.StretchAtExtents
                    },
                    new SCIPinchZoomModifier {
                        Direction = SCIDirection2D.XDirection
                    },
                    new SCIZoomPanModifier(),
                    new SCIZoomExtentsModifier(),
                    new SCILegendModifier {
                        ShowCheckBoxes = false
                    }
                };
            }
        }
예제 #2
0
        private void InitChart(SciChartSurface surface, BasePaneModel model, bool isMainPain)
        {
            var xAxis = new CategoryDateAxis(Activity)
            {
                Visibility = (int)(isMainPain ? ViewStates.Visible : ViewStates.Gone), GrowBy = new DoubleRange(0, 0.05)
            };

            using (surface.SuspendUpdates())
            {
                surface.XAxes.Add(xAxis);
                surface.YAxes.Add(model.YAxis);
                surface.RenderableSeries = model.RenderableSeries;
                surface.Annotations      = model.Annotations;

                surface.ChartModifiers = new ChartModifierCollection
                {
                    new ModifierGroup
                    {
                        MotionEventGroup = "ModifiersSharedEventsGroup",
                        ChildModifiers   = new ChartModifierCollection
                        {
                            new XAxisDragModifier {
                                DragMode = AxisDragModifierBase.AxisDragMode.Pan, ClipModeX = ClipMode.StretchAtExtents
                            }.WithReceiveHandledEvents(true),
                            new PinchZoomModifier {
                                Direction = Direction2D.XDirection
                            }.WithReceiveHandledEvents(true),
                            new ZoomPanModifier().WithReceiveHandledEvents(true),
                            new ZoomExtentsModifier().WithReceiveHandledEvents(true),
                            new LegendModifier(Activity).WithShowCheckBoxes(false),
                        }
                    }.WithReceiveHandledEvents(true)
                };
            }
            _verticalGroup.AddSurfaceToGroup(surface);
        }