当前位置: 首页>>代码示例>>C#>>正文


C# Chart.GetTitlesDockedOutSidePlotArea方法代码示例

本文整理汇总了C#中Visifire.Charts.Chart.GetTitlesDockedOutSidePlotArea方法的典型用法代码示例。如果您正苦于以下问题:C# Chart.GetTitlesDockedOutSidePlotArea方法的具体用法?C# Chart.GetTitlesDockedOutSidePlotArea怎么用?C# Chart.GetTitlesDockedOutSidePlotArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Visifire.Charts.Chart的用法示例。


在下文中一共展示了Chart.GetTitlesDockedOutSidePlotArea方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddTitles

        /// <summary>
        /// Add titles to ChartArea
        /// </summary>
        /// <param name="chart">Chart</param>
        /// <param name="DockInsidePlotArea">DockInsidePlotArea</param>
        /// <param name="height">Height avilable for title</param>
        /// <param name="width">Width available for title</param>
        /// <param name="isHLeftOrRightVCenterTitlesExists">Whether horizontal or vertical titles exists</param>
        private void AddTitles(Chart chart, Boolean DockInsidePlotArea, Double height, Double width, out Boolean isHLeftOrRightVCenterTitlesExists)
        {
            IList<Title> titles;
            StackPanel topTitlePanel = null;
            StackPanel bottomTitlePanel = null;
            StackPanel leftTitlePanel = null;
            StackPanel rightTitlePanel = null;
            StackPanel centerPanel = null;
            isHLeftOrRightVCenterTitlesExists = false;

            if (DockInsidePlotArea)
            {
                // Get the Titles docked outside PlotArea 
                titles = chart.GetTitlesDockedInsidePlotArea();
                topTitlePanel = chart._topInnerTitlePanel;
                bottomTitlePanel = chart._bottomInnerTitlePanel;
                leftTitlePanel = chart._leftInnerTitlePanel;
                rightTitlePanel = chart._rightInnerTitlePanel;
                centerPanel = chart._centerDockInsidePlotAreaPanel;
            }
            else
            {
                // Get the Titles docked outside PlotArea 
                titles = chart.GetTitlesDockedOutSidePlotArea();
                topTitlePanel = chart._topOuterTitlePanel;
                bottomTitlePanel = chart._bottomOuterTitlePanel;
                leftTitlePanel = chart._leftOuterTitlePanel;
                rightTitlePanel = chart._rightOuterTitlePanel;
                centerPanel = chart._centerDockOutsidePlotAreaPanel;
            }    

            if (titles.Count == 0)
                return;

            // Get Titles on the top of the ChartArea using LINQ
            var titlesOnTop = from title in titles
                              where (title.InternalVerticalAlignment == VerticalAlignment.Top && title.Enabled == true)
                              select title;

            // Add Title on the top of the ChartArea
            foreach (Title title in titlesOnTop)
                this.AddTitle(chart, title, topTitlePanel, width, height);

            // Get Titles on the bottom of the ChartArea using LINQ
            var titlesOnBottom = from title in titles
                                 where (title.InternalVerticalAlignment == VerticalAlignment.Bottom && title.Enabled == true)
                                 select title;

            titlesOnBottom.Reverse();

            // Add Title on the bottom of the ChartArea
            foreach (Title title in titlesOnBottom)
                this.AddTitle(chart, title, bottomTitlePanel, width, height);

            // Get Titles on the left of the ChartArea using LINQ
            var titlesAtLeft = from title in titles
                               where ((title.InternalVerticalAlignment == VerticalAlignment.Center || title.InternalVerticalAlignment == VerticalAlignment.Stretch)
                               && title.InternalHorizontalAlignment == HorizontalAlignment.Left
                               && title.Enabled == true)
                               select title;

            if (titlesAtLeft.Count() > 0)
                isHLeftOrRightVCenterTitlesExists = true;

            // Add Title on left of the ChartArea
            foreach (Title title in titlesAtLeft)
                this.AddTitle(chart, title, leftTitlePanel, width, height);


            // Get Titles on the right of the ChartArea using LINQ
            var titlesAtRight = from title in titles
                                where ((title.InternalVerticalAlignment == VerticalAlignment.Center || title.InternalVerticalAlignment == VerticalAlignment.Stretch)
                                && title.InternalHorizontalAlignment == HorizontalAlignment.Right
                                && title.Enabled == true)
                                select title;

            if (titlesAtRight.Count() > 0)
                isHLeftOrRightVCenterTitlesExists = true;

            titlesAtRight.Reverse();

            // Add Title on the right of the ChartArea
            foreach (Title title in titlesAtRight)
                this.AddTitle(chart, title, rightTitlePanel, width, height);

            // Get Titles on the right of the ChartArea using LINQ
            var titlesOnCenter = from title in titles
                                 where ((title.InternalHorizontalAlignment == HorizontalAlignment.Center || title.InternalHorizontalAlignment == HorizontalAlignment.Stretch)
                                 && (title.InternalVerticalAlignment == VerticalAlignment.Center || title.InternalVerticalAlignment == VerticalAlignment.Stretch)
                                 && title.Enabled == true)
                                 select title;

//.........这里部分代码省略.........
开发者ID:tdhieu,项目名称:openvss,代码行数:101,代码来源:ChartArea.cs


注:本文中的Visifire.Charts.Chart.GetTitlesDockedOutSidePlotArea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。