Example #1
0
        public override void Render(AxisVisualContext context)
        {
            Children.Clear();

            if (linearAxisVisualGraph == null)
            {
                linearAxisVisualGraph = new LinearAxisVisualGraph();
            }
            linearAxisVisualGraph.AxisModel       = GetAxisModel();
            linearAxisVisualGraph.LinearAxisModel = GetLinearAxisModel();
            if (ScopeLinearAxis.IsVisible)
            {
                linearAxisVisualGraph.Render(new AxisVisualContext()
                {
                    Render = this
                });
                ScopeLinearAxis.SetGridLines(linearAxisVisualGraph.GetGridLines());
            }
            else
            {
                using (DrawingContext dc = RenderOpen())
                {
                }
                ScopeLinearAxis.SetGridLines(null);
            }
        }
Example #2
0
        public override void Render(AxisVisualContext context)
        {
            Children.Clear();

            if (logarithmicAxisVisualGraph == null)
            {
                logarithmicAxisVisualGraph = new LogarithmicAxisVisualGraph();
            }
            if (linearAxisVisualGraph == null)
            {
                linearAxisVisualGraph = new LinearAxisVisualGraph();
            }
            bool useLog = LogarithmicTickCreator.CanUseLogarithmicTick(new Range <double>(LogarithmicAxis.LogScale.Minimum, LogarithmicAxis.LogScale.Maximum));

            if (useLog)
            {
                LogarithmicAxis.ShowLogAxis                     = true;
                logarithmicAxisVisualGraph.AxisModel            = GetAxisModel();
                logarithmicAxisVisualGraph.LogarithmicAxixModel = GetLogarithmicAxisModel();
                if (LogarithmicAxis.IsVisible)
                {
                    logarithmicAxisVisualGraph.Render(new AxisVisualContext()
                    {
                        Render = this
                    });
                    LogarithmicAxis.SetGridLines(logarithmicAxisVisualGraph.GetGridLines());
                }
                else
                {
                    using (DrawingContext dc = RenderOpen())
                    {
                    }
                    LogarithmicAxis.SetGridLines(null);
                }
                currentAxis = logarithmicAxisVisualGraph;
            }
            else
            {
                LogarithmicAxis.ShowLogAxis           = false;
                linearAxisVisualGraph.AxisModel       = GetAxisModel();
                linearAxisVisualGraph.LinearAxisModel = GetLinearAxisModel();
                if (LogarithmicAxis.IsVisible)
                {
                    linearAxisVisualGraph.Render(new AxisVisualContext()
                    {
                        Render = this
                    });
                    LogarithmicAxis.SetGridLines(linearAxisVisualGraph.GetGridLines());
                }
                else
                {
                    using (DrawingContext dc = RenderOpen())
                    {
                    }
                    LogarithmicAxis.SetGridLines(null);
                }
                currentAxis = linearAxisVisualGraph;
            }
        }