对齐两个图表区域窗口表单 [英] Align two chart areas windows forms

查看:149
本文介绍了对齐两个图表区域窗口表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows窗体应用程序,该应用程序显示由两个图表区域组成的图表,一个图表显示价格/日期,第二个图表显示价格/日期,两者都应在每个图表区域中绘制相同数量的数据点,这是我遇到的问题目前的情况是两个图表都没有垂直对齐,因此对于用户来说它们不是很清晰,我在volumen图表区域中添加了以下属性:

I have a windows forms application that displays a chart compose by two chart areas, one for price/dates and the second displays volume/price, both should get the same amount of datapoints to draw in each chart area, the issue I have at the moment is that both charts are not aligned vertically so they are not very clear for the user, I added the following properties to volumen chart area:

volumeChartArea.AlignWithChartArea = CHART_AREA_PRICES;
volumeChartArea.AlignmentStyle = AreaAlignmentStyles.All;
volumeChartArea.AlignmentOrientation = AreaAlignmentOrientations.Vertical;

但是它们看起来仍然不正确,解决此问题的解决方案是什么?

But they still don't look correct, what could it be the solution to fix this issue?

非常感谢.

推荐答案

像这样的东西?

if (this.chrtMain.ChartAreas.Count > 0)
  {
    ca.AlignmentOrientation = AreaAlignmentOrientations.Vertical;
    ca.AlignWithChartArea = this.chrtMain.ChartAreas[0].Name;
  }

以这种方式添加时,所有图表区域都将对齐.

All chart areas will be aligned as they are added this way.

这篇关于对齐两个图表区域窗口表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆