Resize zedgraph and expand axis ranges
-
Hello, i have a little problem with zedgraph (used in vb.net): On a form lies one zedgraph which shows one chart (curve). I want to resize the form, but not the chart/curve. In the form's resize event i set the size of the control. With ZedGraphControl1 .Top = PanelPatientInfo.Top + PanelPatientInfo.Height .Left = 0 .Height = Me.ClientSize.Height - .Top .Width = Me.ClientSize.Width - .Left End With But when i do this the complete chart is scaled. (It is like zooming in/out...) I want the maximum of the x and y axis to get greater/smaller. How can i do that? Thanks in advance! Croc
-
Hello, i have a little problem with zedgraph (used in vb.net): On a form lies one zedgraph which shows one chart (curve). I want to resize the form, but not the chart/curve. In the form's resize event i set the size of the control. With ZedGraphControl1 .Top = PanelPatientInfo.Top + PanelPatientInfo.Height .Left = 0 .Height = Me.ClientSize.Height - .Top .Width = Me.ClientSize.Width - .Left End With But when i do this the complete chart is scaled. (It is like zooming in/out...) I want the maximum of the x and y axis to get greater/smaller. How can i do that? Thanks in advance! Croc
CrocodileBuck wrote:
I want to resize the form, but not the chart/curve. In the form's resize event i set the size of the control. With ZedGraphControl1 .Top = PanelPatientInfo.Top + PanelPatientInfo.Height .Left = 0 .Height = Me.ClientSize.Height - .Top .Width = Me.ClientSize.Width - .Left End With
Uhhh, maybe I just don't get the requirement, but if you don't want the chart to resize, why did you supply all this code to resize the chart??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
CrocodileBuck wrote:
I want to resize the form, but not the chart/curve. In the form's resize event i set the size of the control. With ZedGraphControl1 .Top = PanelPatientInfo.Top + PanelPatientInfo.Height .Left = 0 .Height = Me.ClientSize.Height - .Top .Width = Me.ClientSize.Width - .Left End With
Uhhh, maybe I just don't get the requirement, but if you don't want the chart to resize, why did you supply all this code to resize the chart??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Hmmm, ok... Let me try to explain it. When i resize the form (on which the zedgraph lies) then the zedgraph should fill the form. This is working fine. What i want is: The bigger the form and the zedgraph control gets, the bigger the max value of the y/x axis should become. Example: My form is 200x200 pixel and the zedgraph too. The maximum value on the y axis is 200. Now i resize the form manually to 300x300. So i want the max value on my y axis to increase from 200 to 300 too. At the moment only the chart (which is contained in the control) gets resized. How can i change the max value of my axis? Many thanks in advance!
-
Hmmm, ok... Let me try to explain it. When i resize the form (on which the zedgraph lies) then the zedgraph should fill the form. This is working fine. What i want is: The bigger the form and the zedgraph control gets, the bigger the max value of the y/x axis should become. Example: My form is 200x200 pixel and the zedgraph too. The maximum value on the y axis is 200. Now i resize the form manually to 300x300. So i want the max value on my y axis to increase from 200 to 300 too. At the moment only the chart (which is contained in the control) gets resized. How can i change the max value of my axis? Many thanks in advance!
alBasic wrote:
How can i change the max value of my axis?
That's a question for a forum that specifically deals with ZedGraph. I have no idea how to use that library since I've never seen it. But, it sounds like all you have to do is take the width of the form and plug that into the Y-Axis of your graph. How you do that is a question for the people who wrote ZedGraph.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008