Resize chart
Resize chart
Hi. We want to maximize our window, and obviously, we need to adjust the chart to the new window size. How can we setup this? We are trying with chart.width and Chart.Height properties but it just allows modify to a lower size than the original, the opposite truncates the chart.
Best regards,
JAV
Best regards,
JAV
Re: Resize chart
Hi JAV,
I've tried to drop a chart and two buttons in a new form and this code seems to behave as expected. Doesn't it for you?
Note you can also use Align property if you want your chart to always be in the left/right/top/bottom/client of your form.
I've tried to drop a chart and two buttons in a new form and this code seems to behave as expected. Doesn't it for you?
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
Chart1.Width:=Chart1.Width-5;
Chart1.Height:=Chart1.Height-5;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Chart1.Width:=Chart1.Width+5;
Chart1.Height:=Chart1.Height+5;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Resize chart
Hi Yeray, thanks for replying.
I am doing exactly that:
But the result is shown in the attached images
I tried to put but I get an error. I don't know if that is the solution but I don't find what is the appropriate sentence.
Thank you very much.
Best regards,
JAV
I am doing exactly that:
Code: Select all
Chart1.Width:=Chart1.Width+300;
Chart1.Height:=Chart1.Height+15;
Code: Select all
Chart1.AutoSize = TRUE
Thank you very much.
Best regards,
JAV
Re: Resize chart
Hi JAV,
What TeeChart and IDE versions are you using?
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
What TeeChart and IDE versions are you using?
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Resize chart
Hi Yeray, thanks for replying.
I'm using TeeChart Pro v8.0.1.1.101222. With OpenEdge Studio 10.2B (4gl). The code is the following:
Thank you very much.
Best regards,
JAV
I'm using TeeChart Pro v8.0.1.1.101222. With OpenEdge Studio 10.2B (4gl). The code is the following:
Code: Select all
// Asigno el puntero de TChart a una variable
gr = chgr1:tc1.
// Guardo el tamaño original de mi ventana
yy_bef = CURRENT-WINDOW:HEIGHT.
xx_bef = CURRENT-WINDOW:WIDTH.
// Asigno el tamaño de la sesión a mi ventana
CURRENT-WINDOW:HEIGHT = SESSION:HEIGHT-CHARS.
CURRENT-WINDOW:WIDTH = SESSION:WIDTH-CHARS.
// Guardo el nuevo tamaño de mi ventana
yy_aft = CURRENT-WINDOW:HEIGHT.
xx_aft = CURRENT-WINDOW:WIDTH.
// Asigno al TChart las dimensiones que debe incrementar
gr:HEIGHT = gr:HEIGHT + (yy_aft - yy_bef).
gr:WIDTH = gr:WIDTH + (xx_aft - xx_bef).
Best regards,
JAV
Re: Resize chart
Hi JAV,
I was trying it with Delphi, excuse me.
Since we don't have OpenEdge Studio here, I've tried now with TeeChart v8.0.1.1.101222 in Visual Basic 6 and this seems to work fine for me with a chart into the form and a button doing this:
So this may be something related to this IDE or some other setting you are using that I may be missing.
I was trying it with Delphi, excuse me.
Since we don't have OpenEdge Studio here, I've tried now with TeeChart v8.0.1.1.101222 in Visual Basic 6 and this seems to work fine for me with a chart into the form and a button doing this:
Code: Select all
Private Sub Command1_Click()
TChart1.Width = TChart1.Width + 30
TChart1.Height = TChart1.Height + 30
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Resize chart
Hi,
I made every test that I could and finally I guess that there is something related with the object of OCX: the OCX is on my window, and my window is being maximized, as well as the image but not the object... That is why the image appears truncated.... is like the ocx is upon a frame or something which I am not maximizing in a properly way. Could you please show me how could I set this attribute on the OCX window or frame, because this on the image is already working?
Thank you very much
I made every test that I could and finally I guess that there is something related with the object of OCX: the OCX is on my window, and my window is being maximized, as well as the image but not the object... That is why the image appears truncated.... is like the ocx is upon a frame or something which I am not maximizing in a properly way. Could you please show me how could I set this attribute on the OCX window or frame, because this on the image is already working?
Thank you very much
Re: Resize chart
Hola,
TeeChart ActiveX isn't embedded into any frame or anything else. I still think it has to be some particularity in your IDE because I can't reproduce it with VB6.
I'd suggest you to try to force a repaint (Chart1.Environment.InternalRepaint) after resizing/maximizing to see if it changes something.
You could also try making the chart invisible and visible again, also after resizing/maximizing.
If you still have problems with it, don't hesitate to let us know.
TeeChart ActiveX isn't embedded into any frame or anything else. I still think it has to be some particularity in your IDE because I can't reproduce it with VB6.
I'd suggest you to try to force a repaint (Chart1.Environment.InternalRepaint) after resizing/maximizing to see if it changes something.
You could also try making the chart invisible and visible again, also after resizing/maximizing.
If you still have problems with it, don't hesitate to let us know.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Resize chart
Hi Yeray:
Can you tell me please where is de property: Auto size, or how to maximize the ocx?
When I put:
or
It returns the attached error:
Thank you very much
Can you tell me please where is de property: Auto size, or how to maximize the ocx?
When I put:
Code: Select all
Chart1.AutoSize = TRUE
Code: Select all
Chart1.MAXIMIZE = TRUE
Re: Resize chart
Hi JAV,
There's no AutoSize property for the TeeChart.TChart object. There is an AutoSize property for Annotation tool, TextShape,... and similar objects, but not for the chart itself.
It has to be something particular in your IDE. Maybe is IDE who embeds the COM components into something that is causing all this: some extra properties, what looks as a frame that isn't resized with the component inside it,... just an hypothesis.
There's no AutoSize property for the TeeChart.TChart object. There is an AutoSize property for Annotation tool, TextShape,... and similar objects, but not for the chart itself.
It has to be something particular in your IDE. Maybe is IDE who embeds the COM components into something that is causing all this: some extra properties, what looks as a frame that isn't resized with the component inside it,... just an hypothesis.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Resize chart
Hola Yeray,
Right now I am working directly on TeeChart Office just to understand how this functionality really works before implement it. There is an attribute or property named Auto Size (please see attached images). This "auto size" option allows to do exactly what I need:
When it is inactive the chart is in its original size even though the frame or window is maximized , when it is active the chart fit the window size. What is the appropriated command line to do this?
Thank you very much, regards
Right now I am working directly on TeeChart Office just to understand how this functionality really works before implement it. There is an attribute or property named Auto Size (please see attached images). This "auto size" option allows to do exactly what I need:
When it is inactive the chart is in its original size even though the frame or window is maximized , when it is active the chart fit the window size. What is the appropriated command line to do this?
Thank you very much, regards
- Attachments
-
- With_AutoSize.JPG (163.22 KiB) Viewed 27790 times
-
- Without_AutoSize.JPG (122.87 KiB) Viewed 27781 times
Re: Resize chart
Hi JAV,
TeeChart Office is developed with TeeChart VCL, not with TeeChart ActiveX.
In VB6 you can use the Align property as mentioned above.
However, I'm not sure in your IDE. And there isn't, either in VB6, a property to align the control to the four sides, like in delphi alClient.
To do the same in TeeChart ActiveX, you still could use a resize event to assign the new chart dimensions.
For example, in VB6, if I have the chart aligned to the bottom, I can use the chart's resize event:
Otherwise, if I don't have the chart aligned anywhere, I can still use the form resize event:
TeeChart Office is developed with TeeChart VCL, not with TeeChart ActiveX.
In VB6 you can use the Align property as mentioned above.
However, I'm not sure in your IDE. And there isn't, either in VB6, a property to align the control to the four sides, like in delphi alClient.
To do the same in TeeChart ActiveX, you still could use a resize event to assign the new chart dimensions.
For example, in VB6, if I have the chart aligned to the bottom, I can use the chart's resize event:
Code: Select all
Private Sub Form_Load()
TChart1.Align = vbAlignBottom
End Sub
Private Sub TChart1_OnResize()
TChart1.Height = Form1.ScaleHeight
End Sub
Code: Select all
Private Sub Form_Load()
TChart1.Align = vbAlignNone
End Sub
Private Sub Form_Resize()
TChart1.Height = Form1.ScaleHeight
TChart1.Width = Form1.ScaleWidth
TChart1.Left = 0
TChart1.Top = 0
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Auto Size property
What are the specific command line to do what is showed in the pictures attached?
We want that our chart adjusts to the window automatically. So we need to program the "yes" check in the option Auto Size.
Thank you very much, regards,
JAV
We want that our chart adjusts to the window automatically. So we need to program the "yes" check in the option Auto Size.
Thank you very much, regards,
JAV
- Attachments
-
- YES.jpg (310.29 KiB) Viewed 27610 times
-
- NO.jpg (244.81 KiB) Viewed 27612 times
Re: Auto Size property
Hi JAV,
Isn't this the same we discussed here?
http://www.teechart.net/support/viewtop ... ign#p57816
Isn't this the same we discussed here?
http://www.teechart.net/support/viewtop ... ign#p57816
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Auto Size property
Hi Yeray,
ok you caught us!
Effectively it is the same discussion! And it is because we still haven't solved the problem: Our IDE works the same as VB6, we have maximized the frame and with resize event we've maximized the activeX, it means, we adjusted the ActiveX to our frame, but the image looks truncated, as we showed in the previous post.
Please, tell us something different, we've already tried every instruction you gave before.
Regards,
ok you caught us!
Effectively it is the same discussion! And it is because we still haven't solved the problem: Our IDE works the same as VB6, we have maximized the frame and with resize event we've maximized the activeX, it means, we adjusted the ActiveX to our frame, but the image looks truncated, as we showed in the previous post.
Please, tell us something different, we've already tried every instruction you gave before.
Regards,
- Attachments
-
- grafico truncado.jpg (78.18 KiB) Viewed 27569 times