Hi,
I have a scrollbar at the bottom of my chart and a legend scrollbar on the chart legend. I have them connected with the code:
ChartTool1.Position := ScrollBar1.Position; in the ScrollBarChange event
and
ScrollBar1.Position := ChartTool1.Position; in the ChartToolScrolled event.
If there are more entries on the legend than there are items per page, the legend starts to shrink in height (windowshades) as the bottom scrollbar nears it's maximum until finally the total items on the legend equals the number of items per page.
At this point, dragging the legend scrollbar produces strange results - if I click-hold the legend scrollbar and move the mouse up, the legend increases in height with the bottom of the legend moving down along with the legend scrollbar while the mouse moves further away from the scrollbar until I am moving the legend scrollbar with the mouse inches away from the scrollbar instead of the mouse tracking the center as it should be doing.
Is there a way to synchronize these two scrollbars without this error?
Thanks.
Legend windowshades when scrlbar and legendscrlbar connected
Re: Legend windowshades when scrlbar and legendscrlbar connected
Hello,
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
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: Legend windowshades when scrlbar and legendscrlbar connected
Hi,
I enclose a simple example project to demonstrate this error.
Scroll the chart bottom scrollbar all the way to the right - observe what happens to the legend height after the legend scrollbar reaches it's bottom.
With the chart bottom scrollbar all the way to the right, click-hold the legend scrollbar and move the mouse up. This does not look right.
Is there a way to synchronize these two scrollbars without this error?
Is there any way to freeze the legend height to a specific height regardless of whether there are enough items in the legend to fill it?
Thanks.
.
I enclose a simple example project to demonstrate this error.
Scroll the chart bottom scrollbar all the way to the right - observe what happens to the legend height after the legend scrollbar reaches it's bottom.
With the chart bottom scrollbar all the way to the right, click-hold the legend scrollbar and move the mouse up. This does not look right.
Is there a way to synchronize these two scrollbars without this error?
Is there any way to freeze the legend height to a specific height regardless of whether there are enough items in the legend to fill it?
Thanks.
.
- Attachments
-
- TeeChartLegend.zip
- (3.29 KiB) Downloaded 653 times
Re: Legend windowshades when scrlbar and legendscrlbar connected
Hi,
I figured it out.
In the ScrollBarChange event, I changed:
ChartTool1.Position := ScrollBar1.Position;
to:
if (ScrollBar1.Position) < dbchart[0].count-((dbchart.Legend.LastValue - dbchart.Legend.FirstValue)) then
ChartTool1.Position := ScrollBar1.Position;
The problem was that I wasn't checking this and the legend scrollbar was being incremented after it had reached it's max.
I think this is a bug - but I have a workaround.
Thanks.
.
I figured it out.
In the ScrollBarChange event, I changed:
ChartTool1.Position := ScrollBar1.Position;
to:
if (ScrollBar1.Position) < dbchart[0].count-((dbchart.Legend.LastValue - dbchart.Legend.FirstValue)) then
ChartTool1.Position := ScrollBar1.Position;
The problem was that I wasn't checking this and the legend scrollbar was being incremented after it had reached it's max.
I think this is a bug - but I have a workaround.
Thanks.
.