Is there any way to include the Legend when Exporting a Chart, e.g., as a Bitmap. Text boxes are included, but not Legends. It is included in the Printing methods but not the Copy/Export methods.
Any ideas?
TChart Legend
Re: TChart Legend
Hi XRS,
The following code in VB6:
Gives the following picture here:
Could you please check it?
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
The following code in VB6:
Code: Select all
Private Sub Form_Load()
'TChart1.Aspect.View3D = False
TChart1.AddSeries scLine
TChart1.Series(0).FillSampleValues 25
TChart1.Environment.InternalRepaint
TChart1.Export.SaveToBitmapFile "C:\tmp\test.bmp"
End Sub
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TChart Legend
Yeray,
Thanks for the reply. I investigated further and find that the Legend IS saved and copied/pasted with the BMP format, but NOT with the JPEG format (neither Save nor Copy works).
Brian
Thanks for the reply. I investigated further and find that the Legend IS saved and copied/pasted with the BMP format, but NOT with the JPEG format (neither Save nor Copy works).
Brian
Re: TChart Legend
Hi Brian,
Again, the following code seems to work fine for me here with TeeChart AX 8.0.0.8 under Visual Basic 6. Could you please check if you are using the latest maintenance release available?
Again, the following code seems to work fine for me here with TeeChart AX 8.0.0.8 under Visual Basic 6. Could you please check if you are using the latest maintenance release available?
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scLine
TChart1.Series(0).FillSampleValues 25
TChart1.Environment.InternalRepaint
TChart1.Export.asJPEG.SaveToFile "C:\tmp\test.jpg"
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TChart Legend
Yeray,
I am using the menu, not doing this programmatically, and I've created two files, one as a BMP, and one as a JPEG file (see attachment). You can see the difference,
Regards, Brian
I am using the menu, not doing this programmatically, and I've created two files, one as a BMP, and one as a JPEG file (see attachment). You can see the difference,
Regards, Brian
- Attachments
-
- test.zip
- (132.63 KiB) Downloaded 418 times
Re: TChart Legend
Hi Brian,
The following code tries to do a chart as similar as possible to yours:
Both the generated test.jpg and saving it through the commander gives the same result for me here:
Could you please modify the code above or send us a simple example project we can run as-is to reproduce the problem here?
The following code tries to do a chart as similar as possible to yours:
Code: Select all
Private Sub Form_Load()
TeeCommander1.Chart = TChart1
TChart1.Aspect.View3D = False
TChart1.AddSeries scArea
TChart1.Series(0).FillSampleValues 250
TChart1.Series(0).asArea.AreaPen.Visible = False
TChart1.Series(0).Pen.Visible = False
TChart1.AddSeries scVolume
TChart1.Series(1).Color = vbYellow
With TChart1.Series(0)
TChart1.Series(1).AddXY .XValues.Value(50), .YValues.Value(50), "", clTeeColor
TChart1.Series(1).AddXY .XValues.Value(100), .YValues.Value(100), "", clTeeColor
TChart1.Series(1).AddXY .XValues.Value(150), .YValues.Value(150), "", clTeeColor
TChart1.Series(1).AddXY .XValues.Value(200), .YValues.Value(200), "", clTeeColor
End With
With TChart1.Legend
.CustomPosition = True
.Left = 900
.Top = 50
.Transparency = 50
End With
With TChart1.Walls.Back
.Color = RGB(128, 255, 255)
.Transparent = False
.Transparency = 50
End With
TChart1.Environment.InternalRepaint
TChart1.Export.asJPEG.SaveToFile "C:\tmp\test.jpg"
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TChart Legend
Yeray,
I was not able to duplicate the problem with your project. In the end I was able to fix it on my side by using the custom positioning setup for the Legend, programmatically similar to what you had done, rather than using the Designer to set it up with Percent Margins. The strange thing is that it worked with v.6 and 7 of TChart, but not v.8. It was only a problem with saving to JPEG, not with BMP.
Anyway, thanks for your help,
Brian
I was not able to duplicate the problem with your project. In the end I was able to fix it on my side by using the custom positioning setup for the Legend, programmatically similar to what you had done, rather than using the Designer to set it up with Percent Margins. The strange thing is that it worked with v.6 and 7 of TChart, but not v.8. It was only a problem with saving to JPEG, not with BMP.
Anyway, thanks for your help,
Brian
Re: TChart Legend
Hi Brian,
I'm glad to see that you've found a solution that fits your wishes!
I'm glad to see that you've found a solution that fits your wishes!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |