2 sets of axisarrowtools for the same axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Gertrude
Newbie
Newbie
Posts: 35
Joined: Thu Mar 11, 2004 5:00 am
Contact:

2 sets of axisarrowtools for the same axis

Post by Gertrude » Wed Jul 16, 2008 7:13 pm

Hi

is it possible to have 2 sets of axis arrow tools for the same axis?

I was thinking of using a pair of small arrows to scroll by a small percentage and a pair of large arrows to scroll by a much larger percentage. I was going to put the small arrow on top of the large arrow. If I click on the small arrow, will just the small arrow receive the click?

If I click on the portion of the large arrow, not covered by the small arrow, will just the large arrow receive the click.

I have been unable to test this as although my arrows show up at design time, they disappear at runtime for some reason.

Is this because my axis is a datetime axis?

Can I use a datetime axis with axisarrow tools?

Also is it possible to show the arrows in a disabled state or to hide them if scrolling is disallowed?

Thanks

Colin

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Jul 17, 2008 8:38 am

Hi Colin,

Here I found a little problem. If you want two arrows superposed, you may want to give preference to the little one. To do this, the little arrow must be above the big one at the tools list. But then, you'll have the big arrow painted above the little one. So you'll be able to click the little arrow but you won't see it.

So probably, it would be easier to do it with simple buttons.
Gertrude wrote:I have been unable to test this as although my arrows show up at design time, they disappear at runtime for some reason.

Is this because my axis is a datetime axis?

Can I use a datetime axis with axisarrow tools?
It's strange, I can see the arrows assigned to a datetime axis. Are you using the latest teechart available at client area?
Gertrude wrote:Also is it possible to show the arrows in a disabled state or to hide them if scrolling is disallowed?
You can use this to deactivate the arrows. And they will disappear automatically:

Code: Select all

ChartTool1.Active := false;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Gertrude
Newbie
Newbie
Posts: 35
Joined: Thu Mar 11, 2004 5:00 am
Contact:

Post by Gertrude » Sat Jul 19, 2008 3:16 pm

Many thanks for your reply.

Sorry, but I do not understand what you mean about using little buttons. How do I put little buttons on the chart axis?

My axisarrows disappear at runtime and my annotation tool fails to respond to a click event at run time although it does show up at runtime. I have not been able to discover why yet.


Regards

Colin

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon Jul 21, 2008 8:14 am

Hi Colin,
Gertrude wrote:Sorry, but I do not understand what you mean about using little buttons. How do I put little buttons on the chart axis?
I mean a Standard TButton. Not any TChart tool. For example, the button which would do something similar as the left arrow could be:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  with Chart1.Axes.Bottom do
  begin
    Automatic := false;
    Minimum := Chart1.Axes.Bottom.Minimum + 1;
    Maximum := Chart1.Axes.Bottom.Maximum + 1;
  end;
end;
Gertrude wrote:My axisarrows disappear at runtime and my annotation tool fails to respond to a click event at run time although it does show up at runtime. I have not been able to discover why yet.
I'm still not able to reproduce any of these issues here. Could you please verify if you are using the latest TeeChart version available? Or could you tell us if you are doing any specific step that we probably miss trying to reproduce them?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Gertrude
Newbie
Newbie
Posts: 35
Joined: Thu Mar 11, 2004 5:00 am
Contact:

Post by Gertrude » Tue Jul 22, 2008 5:40 pm

Hi

Thanks for your reply.

I was afraid that you meant standard buttons.

I really want to use the Chartarrowtools as to me they are aesthetically the least worst way available for the user to scroll the axis.

I have not had time to investigate why the arrows do not show up at runtime. I will try and look at it tomorrow.

Thanks

Colin

Gertrude
Newbie
Newbie
Posts: 35
Joined: Thu Mar 11, 2004 5:00 am
Contact:

Post by Gertrude » Tue Jul 22, 2008 7:25 pm

HI

I've now found out why the ChartTools were not showing at runtime. It is because I had unknowingly disabled the chart.

Now, I've enabled the chart, they appear. The only problem, I now have with the 2 sets of arrows, is that only one of them gets the click event, no matter how hard I try to click on just the small arrow or just the big arrow.

Unfortunately, the charttools only have a single click event.

If they had a double click event, I could then use just one arrow and if a single click was made I could scroll a small amount and if a double click was made then I could scroll a larger amount.

perhaps you would be kind enough to suggest something like this for the next version, or some way to distinguish the 2 arrows.

Now I have to go back to the drawing board and try to figure out some user-friendly way to allow the user to scroll a date-time axis within prescribed limits.

Thanks for your help

Colin

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed Jul 23, 2008 8:40 am

Hi Colin,

I've added you request to the wish list to be considered those enhancements in future releases (TV52013268).

Meanwhile, consider using buttons as I told you before. Or even you could use an Arrow series with only two arrows. This option would be harder to implement as you will need to recalculate the values for the series points every time the chart is scrolled, moved, zoomed... or at OnAfterDraw event.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Gertrude
Newbie
Newbie
Posts: 35
Joined: Thu Mar 11, 2004 5:00 am
Contact:

Post by Gertrude » Wed Jul 23, 2008 5:58 pm

Hi

OK

The problem with all the methods except using a scrollbar is that the user needs to be told somehow how to scroll the chart.

A user is used to the idea of a scrollbar scrolling the screen. But a scrollbar on a TeeChart covers the whole of the side, and so you would expect the panel to scroll not just the chart.

Also scrollbars do not work with datetime axes. (Also I am using a scrollbar to control the amount of a zoom for the chart. Actually instead of a scrollbar for the zoom, I would have liked to have used a 'slider' type of control with an image like a volume control, i.e. an elongated triangle shape, with the difference that the slider can be moved continuously like a scrollbar rather than in discrete steps as is usual for a slider. If you think that is a good idea, feel free to recommend that as well)

Anyway, many thanks for putting forwards my suggestions.

Thanks again

Colin

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Jul 24, 2008 8:20 am

Hi Colin,

1. Scrollbars should work with DateTime axis. Have you received this example from Narcis?

2. So, you are planning to add a slider to do something similar as the Zoom slider does in the Design Time editor?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Gertrude
Newbie
Newbie
Posts: 35
Joined: Thu Mar 11, 2004 5:00 am
Contact:

Post by Gertrude » Wed Jul 30, 2008 9:30 am

Hi

I cannot find the zoom slider in the design time editor.

Do you mean the Chart Editor?

I looked on its zoom and scroll page and saw no zoom slider.

Is there any chance that the zoom slider could become a separate TeeChart component that we could use at run-time?

Thanks

Colin

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed Jul 30, 2008 10:18 am

Hi Colin,

I think I don't understand your request.
I mean the Zoom slider, or trackbar, at ChartEditor -> Chart -> 3D.
To do the same as this trackbar does, you could simply do:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  TrackBar1.Min := 0;
  TrackBar1.Max := 500;

  TrackBar1.Position := Chart1.Aspect.Zoom;
end;

procedure TForm1.TrackBar1Change(Sender: TObject);
begin
  Chart1.Aspect.Zoom := TrackBar1.Position;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Gertrude
Newbie
Newbie
Posts: 35
Joined: Thu Mar 11, 2004 5:00 am
Contact:

Post by Gertrude » Wed Jul 30, 2008 5:51 pm

Hi

I meant, I would like to be able to use it outside of the editor - to be able to put it on a form but link it to a chart.

The problem with a trackbar is it consists of a series of discrete steps, whereas a scroll bar is essentially continuous.

I had not thought of looking tin the 3-d section as my charts are 2-D.

However I'll have a look now I know where it is.


Thanks

Colin

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Jul 31, 2008 8:28 am

Hi Colin,

The code I posted yesterday was for using a trackbar outside of the editor.

Here you have a code I suggest you using a scrollbar with a 2D chart.

Code: Select all

procedure TForm1.ScrollBar1Change(Sender: TObject);
var XIncrement, YIncrement: Double;
begin
  with Series1 do
  begin
    XIncrement := ((MaxXValue - MinXValue) * ScrollBar1.Position / ScrollBar1.Max) / 2;
    YIncrement := ((MaxYValue - MinYValue) * ScrollBar1.Position / ScrollBar1.Max) / 2;

    Chart1.Axes.Bottom.SetMinMax(MinXValue + Xincrement, MaxXValue - Xincrement);
    Chart1.Axes.Left.SetMinMax(MinYValue + Yincrement, MaxYValue - Yincrement);
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ScrollBar1.Min := 0;
  ScrollBar1.Max := 100;
  ScrollBar1.Position := 0;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Gertrude
Newbie
Newbie
Posts: 35
Joined: Thu Mar 11, 2004 5:00 am
Contact:

Post by Gertrude » Thu Jul 31, 2008 5:37 pm

Hi

Thanks.

I think I have worked out the code Ok now.

Thanks again

Colin

Post Reply