Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-10

TAChart cannot zoom

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Leonardo M. Ramé

Hi, I don't know what I did, but I no longer can zoom in / zoom out (by dragging the mouse pointer) my chart. If I draw 1000 data points, they all are drawn into the chart, but I only want to display part of that data, for example 100 points.

Here's the definition of my TAChart object (extracted from the lfm), I hope this help:

   object HAChart: TChart
     Left = 0
     Height = 206
     Top = 302
     Width = 582
     AxisList = <
       item
         Grid.Color = 2434341
         TickColor = clSilver
         Alignment = calRight
         Group = 1
         Marks.Format = '%0.2f'
         Marks.Range.Max = 50
         Marks.Style = smsCustom
         Minors =
         Title.LabelFont.Orientation = 900
       end
       item
         Grid.Color = clGray
         Grid.Visible = False
         Intervals.MaxLength = 100
         Intervals.MinLength = 30
         Alignment = calBottom
         Marks.LabelFont.Orientation = 750
         Marks.Format = '%2:s'
         Marks.Source = ListChartSource1
         Marks.Style = smsLabel
         Minors =
       end>
     BackColor = clBlack
     ExpandPercentage = 5
     Extent.UseYMin = True
     Foot.Brush.Color = clBtnFace
     Foot.Font.Color = clBlue
     Frame.Color = clMedGray
     Title.Brush.Color = clBtnFace
     Title.Font.Color = clBlue
     Title.Text.Strings = (
       'TAChart'
     )
     Toolset = ChartToolset1
     OnAfterDrawBackWall = CandleStickChartAfterDrawBackWall
     OnAfterPaint = CandleStickChartAfterPaint
     Align = alClient
     Color = clBlack
     ParentColor = False
     ParentShowHint = False
     OnMouseMove = CandleStickChartMouseMove
   end

Regards,

Leonardo M. Ram?<br> Medical IT - Griensu S.A.<br> Av. Col?n 636 - Piso 8 Of. A<br> X5000EPT -- C?rdoba<br> Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19<br> Cel.: +54 9 (011) 40871877

Reply by email

Werner Pamler

You have added a ChartToolset and have assigned it to the chart. This deactivates the built-in toolset which is responsible for default zooming and panning. All you have to do is to add another ZoomDragTool to your toolset. To make it respond to dragging with the left mouse button set its Shift property to ssLeft, this is the standard behavior of the built-in zoom tool. If you need panning as well add a ZoomPanTool; by default, it becomes active with the right mouse button. But if you already use these Shift values in tools that are currently in your toolset, select something else, or add a key like ssCtrl, or ssShift (or both) - there are many possibilities.

There are several tutorial which cover zooming in TAChart:

* http://wiki.lazarus.freepascal.org/TAChart_Tutorial:_Chart_Tools,
* http://wiki.lazarus.freepascal.org/TAChart_Tutorial:_Function_Series
* http://wiki.lazarus.freepascal.org/TAChart_Tutorial:_ColorMapSeries,_Zooming

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141021/c8cd3986/attachment.html>

Reply by email

Leonardo M. Ramé
to Werner Pamler

El 21/10/14 a las 15:32, Werner Pamler escibi?:

Show quoted text 17 lines
You have added a ChartToolset and have assigned it to the chart. This deactivates the built-in toolset which is responsible for default zooming and panning. All you have to do is to add another ZoomDragTool to your toolset. To make it respond to dragging with the left mouse button set its Shift property to ssLeft, this is the standard behavior of the built-in zoom tool. If you need panning as well add a ZoomPanTool; by default, it becomes active with the right mouse button. But if you already use these Shift values in tools that are currently in your toolset, select something else, or add a key like ssCtrl, or ssShift (or both) - there are many possibilities. There are several tutorial which cover zooming in TAChart: * http://wiki.lazarus.freepascal.org/TAChart_Tutorial:_Chart_Tools, * http://wiki.lazarus.freepascal.org/TAChart_Tutorial:_Function_Series * http://wiki.lazarus.freepascal.org/TAChart_Tutorial:_ColorMapSeries,_Zooming

Thanks Werner, I'll take a
Leonardo M. Ram?
Medical IT - Griensu S.A.
Av. Col?n 636 - Piso 8 Of. A
X5000EPT -- C?rdoba
Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19 Cel.: +54 9 (011) 40871877

Reply by email