Text overruns Legend bounding box.
Text overruns Legend bounding box.
Hello.
I have an issue where when I have 12 series configured and the top legend is used, the text in the legend for the 12 series overruns the right most edge. I have uploaded an attachment (LegendTextOverrun.rtf) that visuallizes this.
My question is, is there a way to pad the width of the legend, or some other technique to correct this situation. This only seems to be an issue when we have 12 series (the max we allow in our application), configured.
As an alternative perhaps, is there a way to force the top legend to show 2 rows of 6 series titles and checkboxes?
Any advice/guidance would be appreciated to work around this issue.
Thanks,
Ben.
I have an issue where when I have 12 series configured and the top legend is used, the text in the legend for the 12 series overruns the right most edge. I have uploaded an attachment (LegendTextOverrun.rtf) that visuallizes this.
My question is, is there a way to pad the width of the legend, or some other technique to correct this situation. This only seems to be an issue when we have 12 series (the max we allow in our application), configured.
As an alternative perhaps, is there a way to force the top legend to show 2 rows of 6 series titles and checkboxes?
Any advice/guidance would be appreciated to work around this issue.
Thanks,
Ben.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Text overruns Legend bounding box.
I'm afraid the attachment failed, I can not see it here. You might have missed an error message. Please try compressing it in a zip package and including it again. A simple example project we can run "as-is" to reproduce the problem here would be very helpful too.BenW wrote: I have uploaded an attachment (LegendTextOverrun.rtf) that visuallizes this.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Text overruns Legend bounding box.
Hi Narcís!
It's been a long time, since we communicated last, I hope you are doing well!
The file has been uploaded as LegendTextOverrun.zip. We are using a very old version (version 2 ) of the .NET Teechart, and I know you don't support this version, but I'm wondering if that version supported a way to pad the legend width (or some such), so that the text would stay within the legend rectangle?
Regards,
Ben.
It's been a long time, since we communicated last, I hope you are doing well!
The file has been uploaded as LegendTextOverrun.zip. We are using a very old version (version 2 ) of the .NET Teechart, and I know you don't support this version, but I'm wondering if that version supported a way to pad the legend width (or some such), so that the text would stay within the legend rectangle?
Regards,
Ben.
- Attachments
-
- LegendTextOverrun.zip
- (61.43 KiB) Downloaded 819 times
Re: Text overruns Legend bounding box.
Hi Narcis.
Have also posted a sample that shows this issue (LegendTextOverrunExampleCode.zip). This sample is built with Visual Studio 2008.
Thanks,
Ben.
Have also posted a sample that shows this issue (LegendTextOverrunExampleCode.zip). This sample is built with Visual Studio 2008.
Thanks,
Ben.
- Attachments
-
- LegendTextOverrunExampleCode.zip
- Sample code to reproduce legend text overrun issue.
- (15.67 KiB) Downloaded 828 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Text overruns Legend bounding box.
Hi Ben,
Back to the issue, I'm not able to reproduce it with v2013 and this code:
which produces this chart:
Can you reproduce the problem with this code? If not, can you please modify it so that we can try to reproduce the problem here?
Thanks in advance.
Yes, thanks. Hope everything is well with you!It's been a long time, since we communicated last, I hope you are doing well!
Current TeeChart for .NET version is version 2013 (aka v4). No code maintenance is being done in v2. However, we can answer to technical inquiries for this version.The file has been uploaded as LegendTextOverrun.zip. We are using a very old version (version 2 ) of the .NET Teechart, and I know you don't support this version, but I'm wondering if that version supported a way to pad the legend width (or some such), so that the text would stay within the legend rectangle?
Back to the issue, I'm not able to reproduce it with v2013 and this code:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Top;
tChart1.Legend.MaxNumRows = 1;
tChart1.Legend.CheckBoxes = true;
for (int i = 0; i < 12; i++)
{
tChart1.Series.Add(new Steema.TeeChart.Styles.Line()).FillSampleValues();
}
}
Can you reproduce the problem with this code? If not, can you please modify it so that we can try to reproduce the problem here?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Text overruns Legend bounding box.
Hi Narcis.
Even though your sample code has 12 pens, the legend is only showing 4 pens. Shouldn't it be showing 12 pens? It is important to our customer to be able to see all pens configured on the legend.
I did try the copy and pasting the following section of code:
tChart1.Aspect.View3D = false;
tChart1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Top;
tChart1.Legend.MaxNumRows = 1;
tChart1.Legend.CheckBoxes = true;
but sadly that made no difference to the 12 pen legend text overrun issue.
Also, I posted some code that demonstrtes the issue. Have you received that?
Ben.
Even though your sample code has 12 pens, the legend is only showing 4 pens. Shouldn't it be showing 12 pens? It is important to our customer to be able to see all pens configured on the legend.
I did try the copy and pasting the following section of code:
tChart1.Aspect.View3D = false;
tChart1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Top;
tChart1.Legend.MaxNumRows = 1;
tChart1.Legend.CheckBoxes = true;
but sadly that made no difference to the 12 pen legend text overrun issue.
Also, I posted some code that demonstrtes the issue. Have you received that?
Ben.
Re: Text overruns Legend bounding box.
Hello Ben,
If you want see the 12 pens in the legend, you only need adapt the property of legend MaxNumRows as you need. For example, you can change this value, from 1 to 3 as do in next line of code:
Could you tell us if adapting the property MaxNumRow as you like, solve your problem?
Thanks,
If you want see the 12 pens in the legend, you only need adapt the property of legend MaxNumRows as you need. For example, you can change this value, from 1 to 3 as do in next line of code:
Code: Select all
tChart1.Legend.MaxNumRows = 3;
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Text overruns Legend bounding box.
Hi Sandra.
Setting the value to 3 made no difference using the the code sent by Narcis in my test sample (please see attched screen capture in ResultOfMaxNumRowsSetTo3.zip).
It seems that if the width of the Form is wide enough to hold all 12 pens, then the legend will show all 12 pens in a single row instead of forcing them over 3 rows. Is there a way to force the legend to say show the pens over 2 rows?
As an alternative approach and if it's not possible to pad the legend rectangle with a few extra pixels to have the text show within the bounds of the rectangle, is it possible to create a custom legend that shows in a similar manner to the Steema legend?
Thanks,
Ben.
Setting the value to 3 made no difference using the the code sent by Narcis in my test sample (please see attched screen capture in ResultOfMaxNumRowsSetTo3.zip).
It seems that if the width of the Form is wide enough to hold all 12 pens, then the legend will show all 12 pens in a single row instead of forcing them over 3 rows. Is there a way to force the legend to say show the pens over 2 rows?
As an alternative approach and if it's not possible to pad the legend rectangle with a few extra pixels to have the text show within the bounds of the rectangle, is it possible to create a custom legend that shows in a similar manner to the Steema legend?
Thanks,
Ben.
- Attachments
-
- ResultOfMaxNumRowsSetTo3.zip
- Text still overruns legend rectangle with MaxNumRows set to 3.
- (70.95 KiB) Downloaded 900 times
Re: Text overruns Legend bounding box.
Hello BenW,
Ok. I have tried to reproduce your problem using version 2 and version 4 of TeeChartFor.Net and I inform you I can reproduce your problem in latest version 2 of TeeChartFor.Net but not in latest version 4 of TeeChartFor.Net. Therefore, your problem is fixed for latest version 4 of TeeChartFor.Net. Would be very grateful if you can check your project in latest version 4 Build 4.1.2013.05283 and tell us your results. You can download the evaluation version here.
On the other hand, working with latest version 2 you can try to solve the problem creating a custom legend as is demonstrated in the example Christopher Ireland posted here.
I hope will helps.
Thanks,
Ok. I have tried to reproduce your problem using version 2 and version 4 of TeeChartFor.Net and I inform you I can reproduce your problem in latest version 2 of TeeChartFor.Net but not in latest version 4 of TeeChartFor.Net. Therefore, your problem is fixed for latest version 4 of TeeChartFor.Net. Would be very grateful if you can check your project in latest version 4 Build 4.1.2013.05283 and tell us your results. You can download the evaluation version here.
On the other hand, working with latest version 2 you can try to solve the problem creating a custom legend as is demonstrated in the example Christopher Ireland posted here.
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Text overruns Legend bounding box.
Hi Sandra.
Thanks for confrming that this is an issue on V2.
Is there some programatic way to pad the width of the legend rectangle, independently of its contents?
Regards,
Ben.
Thanks for confrming that this is an issue on V2.
Is there some programatic way to pad the width of the legend rectangle, independently of its contents?
Regards,
Ben.
Re: Text overruns Legend bounding box.
Hi Ben,
The only way I can think right now would be to hide the legend and use custom drawing techniques to drawn your custom legend manually.
The only way I can think right now would be to hide the legend and use custom drawing techniques to drawn your custom legend manually.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Text overruns Legend bounding box.
OK, thanks for the update Yeray...
Ben.
Ben.
Re: Text overruns Legend bounding box.
Hi.
I'm trying the evaluation version 4 in place of an official version 2. There were a couple of minor compile errors that needed to be fixed up in moving from V2 to V4, easy to do. However there is a section of code that retrieves the chart Bitmap:
Bitmap bitmap = this.tChart1.Bitmap;
I can't really figure out why, but with V4 this call is throwing a System.NullReferenceException exception (this wasn't ever an issue under V2), the only piece of context after this call in the stack trace is the following line:
> TeeChart.dll!Steema.TeeChart.Chart.Bitmap(int width, int height, System.Drawing.Imaging.PixelFormat pixelformat) + 0x16e bytes
The System.NullReferenceException is also thrown with the following stack trace:
TeeChart.dll!Steema.TeeChart.TChart.OnPaint(System.Windows.Forms.PaintEventArgs pe) + 0x1f7 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {X=0,Y=0,Width=595,Height=492}}, short layer, bool disposeEventArgs = false) + 0xa8 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WmPaint(ref System.Windows.Forms.Message m) + 0xa9f bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x4e6 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x46 bytes
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 15, System.IntPtr wparam, System.IntPtr lparam) + 0xb5 bytes
[Native to Managed Transition]
[Managed to Native Transition]
Is there a V2 to V4 upgrade best practices document that is available that perhaps documents the potential cause of this behaviour, and perhaps how to work around it?
Thanks,
Ben.
I'm trying the evaluation version 4 in place of an official version 2. There were a couple of minor compile errors that needed to be fixed up in moving from V2 to V4, easy to do. However there is a section of code that retrieves the chart Bitmap:
Bitmap bitmap = this.tChart1.Bitmap;
I can't really figure out why, but with V4 this call is throwing a System.NullReferenceException exception (this wasn't ever an issue under V2), the only piece of context after this call in the stack trace is the following line:
> TeeChart.dll!Steema.TeeChart.Chart.Bitmap(int width, int height, System.Drawing.Imaging.PixelFormat pixelformat) + 0x16e bytes
The System.NullReferenceException is also thrown with the following stack trace:
TeeChart.dll!Steema.TeeChart.TChart.OnPaint(System.Windows.Forms.PaintEventArgs pe) + 0x1f7 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {X=0,Y=0,Width=595,Height=492}}, short layer, bool disposeEventArgs = false) + 0xa8 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WmPaint(ref System.Windows.Forms.Message m) + 0xa9f bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x4e6 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x46 bytes
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 15, System.IntPtr wparam, System.IntPtr lparam) + 0xb5 bytes
[Native to Managed Transition]
[Managed to Native Transition]
Is there a V2 to V4 upgrade best practices document that is available that perhaps documents the potential cause of this behaviour, and perhaps how to work around it?
Thanks,
Ben.
Re: Text overruns Legend bounding box.
Hello BenW,
You can reproduce it using my code? If you using my code the problem doesn't appear, Could you please, attach for us a simple project where your problem appears? On the other hand, you can use tChart1.Draw() method if you use Bitmap to redraw() chart.
Thanks,
I can not reproduce your problem using next code:I'm trying the evaluation version 4 in place of an official version 2. There were a couple of minor compile errors that needed to be fixed up in moving from V2 to V4, easy to do. However there is a section of code that retrieves the chart Bitmap:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
line1 = new Line(tChart1.Chart);
line1.FillSampleValues();
Bitmap bmp = tChart1.Bitmap;
}
The all code as you use in V2 should work for V4, but is possible there are some modifications. My recommendations is that you taking a look in the TeeChart Tutorial and References documentation and TeeChartFor.Net Demo to check the methods as you believe change. Moreover, if you have any problems, please let me know and we will try to help you.Is there a V2 to V4 upgrade best practices document that is available that perhaps documents the potential cause of this behavior, and perhaps how to work around it?
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |