If I have multiple vertical axes, each one having a label and I right click and drag up or down far enough, the labels will disappear from all of them at some point.
This may have something to do with the labels all being at the same point on each respective axis (0.0), though all of the axes are not lined up at the same y position (i.e. y=0.0 of one axis is not the same physical ordinate as the y=0.0 of another axis). Looks like some sort of clipping problem.
Is there a fix for this? Perhaps I can override the right click and drag so that I use my own scrolling mechinism? I've implemented a way for my vertical scrollbar to do this vertically, but I do not know how to stop the default mechinism from scrolling the graphs.
Thanks
Adrian
Labels disappering
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Adrian,
I couldn't reproduce the problem here. Could you please send us an example we can run "as-is" and the steps we should follow to reproduce the issue here?
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
I couldn't reproduce the problem here. Could you please send us an example we can run "as-is" and the steps we should follow to reproduce the issue here?
You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
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 |
Code Post
Sorry for not posting my stuff in the newsgroup but I found that this is easier. Though, if you really want me to, I'll do it.
Below is a code fragment to replicate the problem. Create a default C++ MFC project dialogue project. Insert a defaut TChart Pro COM Object into the dialogue and put this into the OnInitDialog() function. You will of course have to include the appropriate header files.
When you right click and drag it up it will eventually make all labels disappear, even though not all labels have left the chart area.
I’ve fixed this by disabling the default scrolling routines and writing my own using the SetMaximumOffset()/SetMinimumOffset() axis functions to position all of the graphs.
Thanks,
Adrian
Below is a code fragment to replicate the problem. Create a default C++ MFC project dialogue project. Insert a defaut TChart Pro COM Object into the dialogue and put this into the OnInitDialog() function. You will of course have to include the appropriate header files.
Code: Select all
CTChart& tchart = *(CTChart*)GetDlgItem(IDC_TCHART1);
enum { eAllTraces = 10 };
long AxisIds[eAllTraces];
long LabelIds[eAllTraces];
long TraceIds[eAllTraces];
for (int index = 0
; index < eAllTraces
; ++index) {
//------------------------------------------------------------------
// Adding custom axis
AxisIds[index] = tchart.GetAxis().AddCustom(false);
CAxis& axis = tchart.GetAxis().GetCustom(AxisIds[index]);
axis.SetMaximumOffset(axis.GetMaximumOffset()+10*index);
axis.SetMinimumOffset(axis.GetMinimumOffset()-10*index);
//------------------------------------------------------------------
// Adding Label
CAxisLabels& labels = axis.GetLabels();
LabelIds[index] = labels.Add(0.0, "");
// Setup label properties
CAxisLabelsItem& label = labels.GetItem(LabelIds[index]);
label.SetShapeStyle(fosRoundRectangle);
label.GetFont().SetSize(10);
label.GetFont().SetBold(true);
label.SetTransparent(false);
//label.SetVisible(false);
//------------------------------------------------------------------
// Adding series (trace)
TraceIds[index] = tchart.AddSeries(scLine);
CSeries& series = tchart.Series(TraceIds[index]);
// Attach the series to the custom axis
series.SetVerticalAxisCustom(AxisIds[index]);
for (double x = 0; x < 1; x += .01) {
double y = (((double)rand()) / RAND_MAX) * 0.2 - 0.1;
series.AddXY(x, y, "", RGB(0xff, 0, 0));
}
}
I’ve fixed this by disabling the default scrolling routines and writing my own using the SetMaximumOffset()/SetMinimumOffset() axis functions to position all of the graphs.
Thanks,
Adrian
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Adrian,
Thanks for the code, I could reproduce the issue here and added it (TV52011535) to our defect list to be fixed for future releases.
Thanks for the code, I could reproduce the issue here and added it (TV52011535) to our defect list to be fixed for future releases.
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 |