C# MSChart - charts area limits

前端 未结 2 879
长发绾君心
长发绾君心 2021-01-15 10:22

I have one Chart and three ChartArea that are aligned in view, zoom, cursor: this is my related previous post. All things works well except that the three ChartArea are not

2条回答
  •  时光说笑
    2021-01-15 10:35

    Have you tried using the chart area alignment options? I would try something like:

    //define inner plot position of the chart areas
    dlChart.ChartAreas[0].InnerPlotPosition.Auto = true;
    dlChart.ChartAreas[1].InnerPlotPosition.Auto = true;
    dlChart.ChartAreas[2].InnerPlotPosition.Auto = true;
    
    //set our second chart area's alignments to match our first chart area
    dlChart.ChartAreas[1].AlignmentOrientation = AreaAlignmentOrientations.Vertical;
    dlChart.ChartAreas[1].AlignmentStyle = AreaAlignmentStyles.All;
    dlChart.ChartAreas[1].AlignWithChartArea = dlChart.ChartAreas[0].Name;
    
    //set our third chart area's alignments to match our first chart area
    dlChart.ChartAreas[2].AlignmentOrientation = AreaAlignmentOrientations.Vertical;
    dlChart.ChartAreas[2].AlignmentStyle = AreaAlignmentStyles.All;
    dlChart.ChartAreas[2].AlignWithChartArea = dlChart.ChartAreas[0].Name;
    

提交回复
热议问题