Hi,
I recently upgraded to the 2011 version of TChart, and am using CBuilder XE. I use custom labels on some of my charts, and I have been adding extra labels off the end of the axes in case the user panned in that direction. It seems now that these labels are visible and clustering up as garbage at the edge of the panel (see attached, left side).
To experiment, I panned a chart with custom labels, and when the label should scroll off and become invisible, it now stays where it is and seems to stop refreshing (see attached, right side - the 100 should have become invisible). If I scroll back again, the label starts refreshing again and resumes normal behaviour.
I haven't yet looked further into it - so would be interested in a quick fix I can do for this problem.
Sam.
Custom labels not invisibilising when scrolled off
Custom labels not invisibilising when scrolled off
- Attachments
-
- CustomLabels.png (11.06 KiB) Viewed 8703 times
Re: Custom labels not invisibilising when scrolled off
Hi Sam,
I'm not sure to understand what should I exactly do to reproduce the problem. Could you please arrange a simple example project we can run as-is to reproduce the problem here (or write detailed step-by-step instructions to follow from zero in a new application).
Thanks in advance.
I'm not sure to understand what should I exactly do to reproduce the problem. Could you please arrange a simple example project we can run as-is to reproduce the problem here (or write detailed step-by-step instructions to follow from zero in a new application).
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: Custom labels not invisibilising when scrolled off
I thought I was pretty clear. Quite simply, you use custom labels, and then drag the chart around to move them off the chart.
But here is your step by step guide:
Create a new project (I'm using C++ Builder XE, TChart 2011).
Plonk a TChart onto the available form.
Add at the top of the cpp file:
Add to the constructor:
Run the application. Using the right mouse button, drag the chart around. Note the behaviour of the labels.
But here is your step by step guide:
Create a new project (I'm using C++ Builder XE, TChart 2011).
Plonk a TChart onto the available form.
Add at the top of the cpp file:
Code: Select all
#include <Series.hpp>
Code: Select all
TLineSeries *thisLineSeries = new TLineSeries(Chart1);
thisLineSeries->AddXY(1,1,"",clBlack);
thisLineSeries->AddXY(10,10,"",clBlack);
thisLineSeries->AddXY(100,100,"",clBlack);
Chart1->AddSeries(thisLineSeries);
Chart1->LeftAxis->Items->Clear();
Chart1->LeftAxis->Items->Add(1,"1");
Chart1->LeftAxis->Items->Add(10,"10");
Chart1->LeftAxis->Items->Add(100,"100");
Re: Custom labels not invisibilising when scrolled off
Adding this to the Scroll event seems to work:
Code: Select all
TChartAxis* Axis;
double dValue(0);
double dMax(0);
double dMin(0);
for(int AxisIndex(0); AxisIndex < Chart1->Axes->Count; AxisIndex++)
{
Axis = Chart1->Axes->Items[AxisIndex];
if(!Axis->Items->Automatic)
{
dMax = Axis->Maximum;
dMin = Axis->Minimum;
for(int LabelIndex(0); LabelIndex < Axis->Items->Count; LabelIndex++)
{
if(Axis->Items->Item[LabelIndex]->Value > dMax ||
Axis->Items->Item[LabelIndex]->Value < dMin)
{
Axis->Items->Item[LabelIndex]->LabelPos = -10;
}
}
}
}
Re: Custom labels not invisibilising when scrolled off
Hi Sam,
Thanks for the explanation and the code. I could reproduce it so I've added it to the defect list to be fixed in future releases (TV52015428). It seems to be broken since v2010.01.
I'm glad to hear you've found a workaround.
Thanks for the explanation and the code. I could reproduce it so I've added it to the defect list to be fixed in future releases (TV52015428). It seems to be broken since v2010.01.
I'm glad to hear you've found a workaround.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Custom labels not invisibilising when scrolled off
Hello,
Status update: An internal fix for his has been added to TeeChart for the next maintenance release.
Regards,
Marc Meumann
Status update: An internal fix for his has been added to TeeChart for the next maintenance release.
Regards,
Marc Meumann
Steema Support