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


C# ChartArea类代码示例

本文整理汇总了C#中ChartArea的典型用法代码示例。如果您正苦于以下问题:C# ChartArea类的具体用法?C# ChartArea怎么用?C# ChartArea使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Details

        public ActionResult Details(int width = 500, int height = 500)
        {
            var chart = new Chart { Height = height, Width = width };
            var chartArea = new ChartArea("Area1")
            {
                AxisX = { Interval = 1 },
                Area3DStyle = { Enable3D = true },
                BackColor = Color.Transparent
            };
            chart.ChartAreas.Add(chartArea);

            chart.BackColor = Color.Transparent;

            var seriescountAll = new Series("项目统计");
            var countAll =
                _iProjectInfoStateService.GetAll()
                    .Select(a => new { Key = a.ProjectInfoStateName, Count = a.ProjectInfos.Count(b => !b.Deleted) });
            seriescountAll.ChartArea = "Area1";
            seriescountAll.IsVisibleInLegend = true;
            seriescountAll.IsValueShownAsLabel = true;
            seriescountAll.Label = "#VALX  #VALY";
            seriescountAll.Points.DataBind(countAll, "Key", "Count", "");
            seriescountAll.ChartType = SeriesChartType.Funnel;
            chart.Series.Add(seriescountAll);

            var imageStream = new MemoryStream();
            chart.SaveImage(imageStream, ChartImageFormat.Png);
            imageStream.Position = 0;
            return new FileStreamResult(imageStream, "image/png");
        }
开发者ID:b9502032,项目名称:MySite,代码行数:30,代码来源:ProjectInfoCountController.cs

示例2: BuildChart

        public MemoryStream BuildChart(int? type, IDictionary<string, float> dataPoints)
        {
            // default to line
            var chartType = type == null ? SeriesChartType.Line : (SeriesChartType)type;

            var chart = new Chart();

            // configure your chart area (dimensions, etc) here.
            var area = new ChartArea();
            chart.ChartAreas.Add(area);
            TickMark tm = new TickMark();

            // create and customize your data series.
            var series = new Series();
            foreach (var item in dataPoints)
            {
                series.Points.AddXY(item.Key, item.Value);
            }

            //series.Label = "#PERCENT{P0}";
            series.Font = new Font("Segoe UI", 8.0f, FontStyle.Bold);
            series.ChartType = chartType;
            series["PieLabelStyle"] = "Outside";

            chart.Series.Add(series);

            var returnStream = new MemoryStream();
            chart.ImageType = ChartImageType.Png;
            chart.SaveImage(returnStream);
            returnStream.Position = 0;

            return returnStream;
        }
开发者ID:seankenny,项目名称:NikNak,代码行数:33,代码来源:ChartingService.cs

示例3: CursorEventArgs

		public CursorEventArgs(ChartArea chartArea, Axis axis, double newSelectionStart, double newSelectionEnd)
		{
			this.ChartArea = chartArea;
			this.Axis = axis;
			this.NewSelectionStart = newSelectionStart;
			this.NewSelectionEnd = newSelectionEnd;
		}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:CursorEventArgs.cs

示例4: ChartWindow

		public ChartWindow(CandleSeries candleSeries)
		{
			InitializeComponent();

			if (candleSeries.IsNull())
				throw new ArgumentNullException("candleSeries");

			_candleSeries = candleSeries;
			_trader = MainWindow.Instance.Trader;

			Chart.ChartTheme = "ExpressionDark";

			var area = new ChartArea();
			Chart.Areas.Add(area);

			_candleElem = new ChartCandleElement
			{
				Antialiasing = false, 
				UpFillColor = Colors.White,
				UpBorderColor = Colors.Black,
				DownFillColor = Colors.Black,
				DownBorderColor = Colors.Black,
			};

			area.Elements.Add(_candleElem);

			_trader.NewCandles += ProcessNewCandles;
			_trader.SubscribeCandles(_candleSeries, DateTime.Today - TimeSpan.FromTicks(((TimeSpan)candleSeries.Arg).Ticks * 100), DateTimeOffset.MaxValue);
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:29,代码来源:ChartWindow.xaml.cs

示例5: CreateColumnChartArea

 public ChartArea CreateColumnChartArea()
 {
     ChartArea chartArea = new ChartArea();
     chartArea.Name = "Result Chart";
     chartArea.BackColor = Color.Transparent;
     chartArea.AxisX.IsLabelAutoFit = false;
     chartArea.AxisY.IsLabelAutoFit = false;
     chartArea.AxisX.LabelStyle.Font =
        new Font("Verdana,Arial,Helvetica,sans-serif",
                 8F, FontStyle.Regular);
     chartArea.AxisY.LabelStyle.Font =
        new Font("Verdana,Arial,Helvetica,sans-serif",
                 8F, FontStyle.Regular);
     chartArea.AxisY.LineColor = Color.FromArgb(64, 64, 64, 64);
     chartArea.AxisX.LineColor = Color.FromArgb(64, 64, 64, 64);
     chartArea.AxisY.MajorGrid.LineColor = Color.FromArgb(64, 64, 64, 64);
     chartArea.AxisX.MajorGrid.LineColor = Color.FromArgb(64, 64, 64, 64);
     chartArea.AxisX.Interval = 1;
     chartArea.AxisX.LabelStyle.Enabled = false;
     chartArea.Position.Height = 80;
     chartArea.Position.Width = 85;
     chartArea.Position.X = 2;
     chartArea.Position.Y = 14;
     return chartArea;
 }
开发者ID:pvthang810,项目名称:PsMModel,代码行数:25,代码来源:ChartExampleController.cs

示例6: ChartWindow

		public ChartWindow(CandleSeries candleSeries, DateTime from, DateTime to)
		{
			InitializeComponent();

			if (candleSeries == null)
				throw new ArgumentNullException("candleSeries");

			_candleSeries = candleSeries;
			_trader = MainWindow.Instance.Trader;

			Chart.ChartTheme = "ExpressionDark";

			var area = new ChartArea();
			Chart.Areas.Add(area);

			_candleElem = new ChartCandleElement
			{
				Antialiasing = false, 
				UpFillColor = Colors.White,
				UpBorderColor = Colors.Black,
				DownFillColor = Colors.Black,
				DownBorderColor = Colors.Black,
			};

			area.Elements.Add(_candleElem);

			_trader.NewCandles += ProcessNewCandles;
			_trader.SubscribeCandles(_candleSeries, from, to);
		}
开发者ID:hbwjz,项目名称:StockSharp,代码行数:29,代码来源:ChartWindow.xaml.cs

示例7: CreateChart

        public static void CreateChart(string imagePath,string name, IEnumerable<BenchResult> results, Func<BenchResult,double> selector)
        {
            Chart chart = new Chart();
            chart.Width = 500;
            chart.Height = 400;
            chart.Titles.Add(name);
            var area = new ChartArea("Default");
            chart.ChartAreas.Add(area);
            var series = new Series("Default");
            chart.Series.Add(series);
            area.AxisX.LabelAutoFitStyle = LabelAutoFitStyles.LabelsAngleStep90;
            area.AxisX.LabelStyle.TruncatedLabels = false;
            area.AxisX.Interval = 1;
            series.ChartType = SeriesChartType.Column;
            series.IsValueShownAsLabel = true;
            series.XValueType = ChartValueType.String;

            series.YValueType = ChartValueType.Int32;

            foreach(var r in results.OrderBy( r => selector(r)))
            {
                DataPoint point = new DataPoint();
                point.SetValueXY(r.Serializer.Replace("Adapter",""),(int)Math.Round(selector(r)));
                point.AxisLabel = r.Serializer.Replace("Adapter", "");
                series.Points.Add(point);
            }

            chart.SaveImage(imagePath, ChartImageFormat.Png);
        }
开发者ID:etishor,项目名称:SerializationTests,代码行数:29,代码来源:ChartHelper.cs

示例8: HistoryCandlesWindow

		public HistoryCandlesWindow(Security security)
		{
			if (security == null)
				throw new ArgumentNullException("security");

			_security = security;

			InitializeComponent();
			Title = _security.Code + LocalizedStrings.Str3747;

			TimeFramePicker.ItemsSource = new[]
			{
				TimeSpan.FromMinutes(1),
				TimeSpan.FromMinutes(5),
				TimeSpan.FromMinutes(15),
				TimeSpan.FromMinutes(60),
				TimeSpan.FromDays(1),
				TimeSpan.FromDays(7),
				TimeSpan.FromTicks(TimeHelper.TicksPerMonth)
			};
			TimeFramePicker.SelectedIndex = 1;

			DateFromPicker.Value = DateTime.Today.AddDays(-7);
			DateToPicker.Value = DateTime.Today;

			var area = new ChartArea();
			_candlesElem = new ChartCandleElement();
			area.Elements.Add(_candlesElem);

			Chart.Areas.Add(area);
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:31,代码来源:HistoryCandlesWindow.xaml.cs

示例9: MainWindow

		public MainWindow()
		{
			InitializeComponent();

			_logManager.Listeners.Add(new GuiLogListener(LogControl));

			_area = new ChartArea();
			_chart.Areas.Add(_area);
		}
开发者ID:vikewoods,项目名称:StockSharp,代码行数:9,代码来源:MainWindow.xaml.cs

示例10: MainWindow

		public MainWindow()
		{
			InitializeComponent();

			_area = new ChartArea();
			Chart.Areas.Add(_area);

			// попробовать сразу найти месторасположение Quik по запущенному процессу
			Path.Text = QuikTerminal.GetDefaultPath();
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:10,代码来源:MainWindow.xaml.cs

示例11: ChartWindow

		public ChartWindow()
		{
			InitializeComponent();

			var area = new ChartArea();
			Chart.Areas.Add(area);

			_candlesElem = new ChartCandleElement();
			area.Elements.Add(_candlesElem);
		}
开发者ID:zjxbetter,项目名称:StockSharp,代码行数:10,代码来源:ChartWindow.xaml.cs

示例12: Details

        public FileResult Details(int width = 1000, int height = 618)
        {
            var sysUserLog = _sysUserLogService.GetAllEnt();
            var sysLog = _sysLogService.GetAllEnt();

            var chart = new Chart { Height = height, Width = width };
            var chartArea = new ChartArea("Area1") {AxisX = {Interval = 1}};
            chart.ChartAreas.Add(chartArea);
            var legend = new Legend();
            chart.Legends.Add(legend);

            var seriescountAll = new Series("使用次数");
            var countAll =
                sysUserLog.GroupBy(a => EntityFunctions.TruncateTime(a.CreatedDate))
                         .Select(a => new { Key = a.Key.Value, Count = a.Count() })
                         .OrderBy(a => a.Key);
            seriescountAll.ChartArea = "Area1";
            seriescountAll.IsVisibleInLegend = true;
            seriescountAll.IsValueShownAsLabel = true;
            seriescountAll.Points.DataBind(countAll, "Key", "Count", "");
            seriescountAll.ChartType = SeriesChartType.Column;
            chart.Series.Add(seriescountAll);


            var seriescountUser = new Series("登陆用户数量");
            var countUser =
                sysUserLog.GroupBy(a => EntityFunctions.TruncateTime(a.CreatedDate)).Select(
                    a => new { Key = a.Key.Value, Count = a.Select(c => c.SysUserId).Distinct().Count() })
                         .OrderBy(a => a.Key);
            seriescountUser.ChartArea = "Area1";
            seriescountUser.IsVisibleInLegend = true;
            seriescountUser.IsValueShownAsLabel = true;
            seriescountUser.Points.DataBind(countUser, "Key", "Count", "");
            seriescountUser.ChartType = SeriesChartType.Column;
            chart.Series.Add(seriescountUser);


            var seriessysLogChart = new Series("系统日志");
            var sysLogChart =
                sysLog.GroupBy(a => EntityFunctions.TruncateTime(a.CreatedDate))
                      .Select(a => new { Key = a.Key.Value, Count = a.Count() })
                      .OrderBy(a => a.Key);
            seriessysLogChart.ChartArea = "Area1";
            seriessysLogChart.IsVisibleInLegend = true;
            seriessysLogChart.IsValueShownAsLabel = true;
            seriessysLogChart.Points.DataBind(sysLogChart, "Key", "Count", "");
            seriessysLogChart.ChartType = SeriesChartType.Column;
            chart.Series.Add(seriessysLogChart);


            var imageStream = new MemoryStream();
            chart.SaveImage(imageStream, ChartImageFormat.Png);
            imageStream.Position = 0;
            return new FileStreamResult(imageStream, "image/png");
        }
开发者ID:peisheng,项目名称:EASYFRAMEWORK,代码行数:55,代码来源:SysStatisticController.cs

示例13: ChartAddElementCommand

		public ChartAddElementCommand(ChartArea area, IChartElement element)
		{
			if (area == null)
				throw new ArgumentNullException("area");

			if (element == null)
				throw new ArgumentNullException("element");

			Area = area;
			Element = element;
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:11,代码来源:ChartAddElementCommand.cs

示例14: ChartRemoveElementCommand

		public ChartRemoveElementCommand(ChartArea area, IChartElement element)
		{
			if (area == null)
				throw new ArgumentNullException(nameof(area));

			if (element == null)
				throw new ArgumentNullException(nameof(element));

			Area = area;
			Element = element;
		}
开发者ID:RakotVT,项目名称:StockSharp,代码行数:11,代码来源:ChartRemoveElementCommand.cs

示例15: CreateChartArea

        protected override ChartArea CreateChartArea()
        {
            ChartArea chartArea = new ChartArea();
            chartArea.AxisX.IsMarginVisible = false;
            chartArea.AxisX.LabelStyle.Enabled = false;
            chartArea.BorderDashStyle = ChartDashStyle.NotSet;

            ConfigureAxis(chartArea.AxisX);
            ConfigureAxis(chartArea.AxisY);

            return chartArea;
        }
开发者ID:benhejl,项目名称:SWENG500_Team1,代码行数:12,代码来源:OpenVsResolvedGraph.cs


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