Align two chart areas windows forms

核能气质少年 提交于 2019-12-13 06:02:03

问题


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?

Many thanks in advance.


回答1:


something like this maybe?

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.



来源:https://stackoverflow.com/questions/17348383/align-two-chart-areas-windows-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!