07-30-2009 06:30 AM
Hello
I have two scattergraphs with the same XAxis Range. When I zoom in, the YAxis is scaled new and the graphs look like in the attached jpg.
Is it possible to draw the plotarea with the same width?
Best regards
Gerald
07-31-2009 08:49 AM - edited 07-31-2009 08:54 AM
Hi Gerald,
as far as I have seen the PlotAreaBounds attributes are readonly.
Therefore, in order to align your y axes, you would have to perform a small workaround (C# example):
private void button1_Click(object sender, EventArgs e)
{
int[] dimensions = new int[3];
// aligns the graphs to the left border of a plot
// scattergraph1: master graph
dimensions[0] = scatterGraph1.PlotAreaBounds.Left; // left plot area border (master plot)
dimensions[1] = dimensions[0]-scatterGraph1.Left; // space for y axes
dimensions[2] = scatterGraph2.PlotAreaBounds.Left; // left plot area border (slave plot)
// set slave graph plot
scatterGraph2.Left += dimensions[0] - dimensions[2]; // move graph by required amount
scatterGraph2.Width -= dimensions[0] - dimensions[2]; // crop graph
}
This code will simply move the second graph in order to align the graph borders. The result will look like pictured in the attached image.
Please let us know if you need more information.
Best regards