Display problem with Legend
Display problem with Legend
Hi Support,
once the legend items have been changed as follows
tChart1.Legend.Items[(int)numericUpDown1.Value].Text = textBox2.Text
the legend items no longer remain in the legend box when the window is resized. This happens in the TChart demo application.
In the demo application:
Under All features/Miscellaneous/Legend/Legend items
If the window is resized the legend redraws ok.
But if one of the legend items has been changed (in the text box) and then the window is resized the legend does not redraw correctly.
Can you provide a work around for this?
regards
Mark
once the legend items have been changed as follows
tChart1.Legend.Items[(int)numericUpDown1.Value].Text = textBox2.Text
the legend items no longer remain in the legend box when the window is resized. This happens in the TChart demo application.
In the demo application:
Under All features/Miscellaneous/Legend/Legend items
If the window is resized the legend redraws ok.
But if one of the legend items has been changed (in the text box) and then the window is resized the legend does not redraw correctly.
Can you provide a work around for this?
regards
Mark
Re: Display problem with Legend
Hi Mark,
Yes, this is a known bug already in the defect list to be fixed in further releases (TV52012509). I've incremented the issue priority.
Yes, this is a known bug already in the defect list to be fixed in further releases (TV52012509). I've incremented the issue priority.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Display problem with Legend
Hi Yeray,
thank you for the quick update.
I do hope this can be fixed asap as this is problem for our customer.
When can we expect the next maintenance release of TChart for .Net 4.0?
I had spent some time wondering if there was something that I was doing wrong as in my code the series items in the legend were over writing the legend title! Then I resized the window!
It is unfortunate that some of TChart's excellent features are marred by defects that (at least to me) indicate in sufficient testing at Steema. I'm not sure if it's just the particular way our software needs to use the TChart features but it sure is frustrating at times!
regards
Mark
thank you for the quick update.
I do hope this can be fixed asap as this is problem for our customer.
When can we expect the next maintenance release of TChart for .Net 4.0?
I had spent some time wondering if there was something that I was doing wrong as in my code the series items in the legend were over writing the legend title! Then I resized the window!
It is unfortunate that some of TChart's excellent features are marred by defects that (at least to me) indicate in sufficient testing at Steema. I'm not sure if it's just the particular way our software needs to use the TChart features but it sure is frustrating at times!
regards
Mark
Re: Display problem with Legend
Hi Mark,
At this moment, I'm afraid I can't think on another workaround different than drawing your custom legend manually with canvas routines.
Note that TeeChart sources are constantly changing, adding new features and fixing identified problems. Applying these changes, unfortunately, may affect other functionalities (sometimes positively and sometimes negatively) and, as you'll understand, we can't test all the functionalities in detail each time we change something. Anyway, I'd like to apologize for the inconvenience.
At this moment, I'm afraid I can't think on another workaround different than drawing your custom legend manually with canvas routines.
Note that TeeChart sources are constantly changing, adding new features and fixing identified problems. Applying these changes, unfortunately, may affect other functionalities (sometimes positively and sometimes negatively) and, as you'll understand, we can't test all the functionalities in detail each time we change something. Anyway, I'd like to apologize for the inconvenience.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Display problem with Legend
Hi Yeray,
well it was easier (ie, less work) for me to fix the defect in the TChart source code and rebuild TChart.dll for our application than to write a custom legend control. The unfortunate part is that we now have a customized TChart.
Anyway this is not the forum to debate this and I thankyou for your time.
regards
Mark
well it was easier (ie, less work) for me to fix the defect in the TChart source code and rebuild TChart.dll for our application than to write a custom legend control. The unfortunate part is that we now have a customized TChart.
Well, automated testing can go a long way to mitigate the problem of not be able to test everything in detail manually. For example, we run 1000's of tests everytime our software builds on the build PC's and a build is run whenever there is a pending change in the source code respository.Applying these changes, unfortunately, may affect other functionalities (sometimes positively and sometimes negatively) and, as you'll understand, we can't test all the functionalities in detail each time we change something.
Anyway this is not the forum to debate this and I thankyou for your time.
regards
Mark
Re: Display problem with Legend
Hi Mark,
Is this how you fixed it?
The issue is that setting the Items.Text also sets Items.Custom to true, meaning that the automatically calculated positions are ignored. So, changing this around so that setting the Text doesn't set Custom to true means that 1) you can set text and have automatic positioning 2) if you *later* set Custom to True you can use custom positioning.VarMelb wrote:well it was easier (ie, less work) for me to fix the defect in the TChart source code and rebuild TChart.dll for our application than to write a custom legend control. The unfortunate part is that we now have a customized TChart.
Is this how you fixed it?
Thanks for your commentaries, we'll try to improve our methodology. And don't worry! Constructive suggestions are always welcome.VarMelb wrote:Well, automated testing can go a long way to mitigate the problem of not be able to test everything in detail manually. For example, we run 1000's of tests everytime our software builds on the build PC's and a build is run whenever there is a pending change in the source code respository.
Anyway this is not the forum to debate this and I thankyou for your time.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Display problem with Legend
Hi Yeray,
sorry for the delay - I've been on leave.
regards
Mark
sorry for the delay - I've been on leave.
I mostly deleted code (about 4 or 5 lines) in DrawLegendItem. Do you want me to post here or email it to you?The issue is that setting the Items.Text also sets Items.Custom to true, meaning that the automatically calculated positions are ignored. So, changing this around so that setting the Text doesn't set Custom to true means that 1) you can set text and have automatic positioning 2) if you *later* set Custom to True you can use custom positioning.
Is this how you fixed it?
regards
Mark
Re: Display problem with Legend
Hi Mark,
DrawLegendItem has about 230 lines of code. It would be better if you could send your modifications to our upload page.
DrawLegendItem has about 230 lines of code. It would be better if you could send your modifications to our upload page.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Display problem with Legend
Hi Yeray,
I have uploaded the modified Legend.cs file.
You will note that the modified code does not support custom positioning of legend items which is ok for our application but not really a general solution. As I see it the problem appears to be due to the one flag (Item.Custom) being used to identify two possible changes, item text and item position. Our application only needs to change item text so using the default item position in a legend was a good quick fix that works for us. The better solution is to make the X and Y custom position of an item relative to the top left position of the legend.
regards
Mark
I have uploaded the modified Legend.cs file.
You will note that the modified code does not support custom positioning of legend items which is ok for our application but not really a general solution. As I see it the problem appears to be due to the one flag (Item.Custom) being used to identify two possible changes, item text and item position. Our application only needs to change item text so using the default item position in a legend was a good quick fix that works for us. The better solution is to make the X and Y custom position of an item relative to the top left position of the legend.
regards
Mark
Re: Display problem with Legend
Hi Mark,
I think that our solution should be more flexible and shouldn't break other charts.
As you are a source code customer, I've sent the latest Legend.cs to you by mail.
I think that our solution should be more flexible and shouldn't break other charts.
As you are a source code customer, I've sent the latest Legend.cs to you by mail.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Display problem with Legend
Hi Yeray,
I have incorporated the code you emailed me into our custom build and it works fine.
Thankyou for the support.
regards
Mark
I have incorporated the code you emailed me into our custom build and it works fine.
Thankyou for the support.
regards
Mark
Re: Display problem with Legend
Hi Mark,
I'm glad to hear that!
I'm glad to hear that!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |