private XYDiagramPaneBase CheckAddPanel(StrategyDataItemInfo info)
        {
            XYDiagram diagram = (XYDiagram)Chart.Diagram;

            if (diagram == null)
            {
                return(null);
            }
            diagram.AxisY.WholeRange.AlwaysShowZeroLevel = false;
            if (info.PanelName == "Default")
            {
                return(diagram.DefaultPane);
            }
            XYDiagramPane pane = null;

            if (diagram.Panes[info.PanelName] != null)
            {
                pane = diagram.Panes[info.PanelName];
            }
            IResizeableArray items = GetDataSource(info) as IResizeableArray;

            if (items != null && !(GetArgumentValue(info, items.GetItem(0)) is DateTime))
            {
                if (info.PanelName == "Default")
                {
                }
                else
                {
                    SecondaryAxisX axisX = new SecondaryAxisX();
                    axisX.Name = info.AxisXName;
                    diagram.SecondaryAxesX.Add(axisX);
                }
            }

            if (pane == null || info.Reversed)
            {
                SecondaryAxisY axis = new SecondaryAxisY();
                axis.Assign(diagram.AxisY);
                axis.Name    = info.AxisYName;
                axis.Reverse = info.Reversed;
                diagram.SecondaryAxesY.Add(axis);
            }
            if (pane == null)
            {
                pane = new XYDiagramPane()
                {
                    Name = info.PanelName
                };
                diagram.Panes.Add(pane);
                Legend l = new Legend();
                l.Assign(Chart.Legend); l.Name = info.PanelName;
                l.DockTarget = pane;
                Chart.Legends.Add(l);
            }
            if (!info.PanelVisible)
            {
                pane.Visibility = ChartElementVisibility.Hidden;
            }
            return(pane);
        }
Exemple #2
0
        private XYDiagramPaneBase CheckAddPanel(StrategyDataItemInfo info)
        {
            XYDiagram diagram = (XYDiagram)Chart.Diagram;

            if (diagram == null)
            {
                return(null);
            }
            diagram.AxisY.WholeRange.AlwaysShowZeroLevel = false;
            if (info.PanelName == "Default")
            {
                return(diagram.DefaultPane);
            }
            XYDiagramPane pane = null;

            if (diagram.Panes[info.PanelName] != null)
            {
                pane = diagram.Panes[info.PanelName];
            }

            if (pane == null || info.Reversed)
            {
                SecondaryAxisY axis = new SecondaryAxisY();
                axis.Assign(diagram.AxisY);
                axis.Name    = info.AxisYName;
                axis.Reverse = info.Reversed;
                diagram.SecondaryAxesY.Add(axis);
            }
            if (pane == null)
            {
                pane = new XYDiagramPane()
                {
                    Name = info.PanelName
                };
                diagram.Panes.Add(pane);
                Legend l = new Legend();
                l.Assign(Chart.Legend); l.Name = info.PanelName;
                l.DockTarget = pane;
                Chart.Legends.Add(l);
            }
            if (!info.PanelVisible)
            {
                pane.Visibility = ChartElementVisibility.Hidden;
            }
            return(pane);
        }