Hello.
I have a problem for rezise two graph in my MasterPane. I would want that the first is twice as big and second twice as small.
public void CreateChartSynchro( ZedGraphControl gs )
{
MasterPane master = gs.MasterPane;
// Fill the background
master.Fill = new Fill( System.Drawing.Color.White, System.Drawing.Color.FromArgb( 220, 220, 255 ), 45.0f );
// Clear out the initial GraphPane
master.PaneList.Clear();
// Leave a margin around the masterpane, but only a small gap between panes
master.Margin.All = 0;
//ecart entre les deux graphs
master.InnerPaneGap = 0;
// Horizontal pan and zoom allowed
gs.IsEnableHPan = true;
gs.IsEnableHZoom = true;
// Creation du Graph1 en tenant compte du MasterPane
GraphPane myPane1 = new GraphPane( new Rectangle( 10, 10, 800, 600 ),
"Activité temporelle",
"Temps",
"Pistes");
// Creation du Graph2 en tenant compte du MasterPane
GraphPane myPane2 = new GraphPane( new Rectangle( 10, 600, 400, 300 ),
"Recouvrement",
"Temps",
"Niveaux");
myPane1.IsFontsScaled = true;
myPane2.IsFontsScaled = true;
// Ajout des GraphPane dans le MasterPane.PaneList
master.Add( myPane1 );
master.Add( myPane2 );
using ( Graphics g = this.CreateGraphics() )
{
// Align the GraphPanes vertically
master.SetLayout( g, PaneLayout.SingleColumn);
master.DoLayout(g);
master.AxisChange( g );
// Synchronize the Axes
gs.IsAutoScrollRange = true;
gs.IsShowHScrollBar = true;
gs.IsShowVScrollBar = true;
gs.IsSynchronizeXAxes = true;
// Vertical pan and zoom not allowed
gs.IsEnableVPan = false;
gs.IsEnableVZoom = false;
gs.MasterPane.Margin.All = 0; //ne marche pas
g.Dispose();
}
I looked on the forum and tried full of things, but they stay in the same size. Thank you for your help J
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I always have my problem.
It's my Resize function :
protected void SetSize()
{
using (Graphics g = this.CreateGraphics())
{
myPane1.ReSize(g, new Rectangle (0,0,1112,550));
myPane2.ReSize(g, new Rectangle (0,550,1112,280));
zgl.AxisChange();
}
zgl.Update();
zgl.Refresh();
}
I haven't got SetLayout, but when I modify the dimension of my Form, my GraphPane takes again default Layout.
protectedvoidSetSize(){using(Graphicsg=this.CreateGraphics()){myPane1.ReSize(g,newRectangle(0,0,1112,550));myPane1.BaseDimension=8F;myPane2.ReSize(g,newRectangle(0,550,1112,280));myPane2.BaseDimension=8F;zgl.AxisChange();// Synchronize the Axeszgl.IsSynchronizeXAxes=true;myPane2.Margin.Left=25;myPane2.Margin.Right=0;}zgl.MasterPane.IsFontsScaled=false;zgl.MasterPane.BaseDimension=8.0F;myPane1.IsFontsScaled=false;myPane1.BaseDimension=8.0F;myPane2.IsFontsScaled=false;myPane2.BaseDimension=8.0F;zgl.ZoomStepFraction=0.05;zgl.Update();zgl.Refresh();}#endregionSetSize
And I have changed that in my CreateChartSynchro :
using ( Graphics g = this.CreateGraphics() )
{
// Align the GraphPanes vertically
master.SetLayout(g,2,1);
master.AxisChange( g );
//master.IsCommonScaleFactor = false;
// Synchronize the Axes
//gs.IsAutoScrollRange = true;
//gs.IsShowHScrollBar = true;
//gs.IsShowVScrollBar = true;
gs.IsSynchronizeXAxes = true;
// Vertical pan and zoom not allowed
gs.IsEnableVPan = false;
gs.IsEnableVZoom = false;
g.Dispose();
}
//gere l'intensité du zoom
//gs.ZoomStepFraction = 1.5;
gs.AxisChange();
Thank you for your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello.
I have a problem for rezise two graph in my MasterPane. I would want that the first is twice as big and second twice as small.
public void CreateChartSynchro( ZedGraphControl gs )
I looked on the forum and tried full of things, but they stay in the same size. Thank you for your help J
I always have my problem.
It's my Resize function :
protected void SetSize()
{
using (Graphics g = this.CreateGraphics())
{
myPane1.ReSize(g, new Rectangle (0,0,1112,550));
myPane2.ReSize(g, new Rectangle (0,550,1112,280));
zgl.AxisChange();
}
zgl.Update();
zgl.Refresh();
}
I haven't got SetLayout, but when I modify the dimension of my Form, my GraphPane takes again default Layout.
2 screenshots to illustrate :
Origin :
http://www.casimages.com/img.php?i=070808024544975837.jpg
After modification of my Form :
http://www.casimages.com/img.php?i=070808024704975845.jpg
Thx
up please :)
Anyone ?
Hello
I succeeded in resize, but I have a problem when I resize my Form, the size of the two becomes again that of the standard setlayout.
Can you explain me please ?
For example :
Origin :
http://www.casimages.com/img.php?i=070724022610908482.jpg
With resize Form :
http://www.casimages.com/img.php?i=070724022802908499.jpg
My SetSize fonction :
And I have changed that in my CreateChartSynchro :
Thank you for your help.
up ;)