Recent

Author Topic: Gantt chart  (Read 4937 times)

usbdoo

  • New Member
  • *
  • Posts: 11
Gantt chart
« on: September 09, 2020, 11:30:56 am »
Looking for a free component Gantt Chart.
Something similar.

en.wikipedia.org/wiki/Gantt_chart
Can anyone help?
Thanks

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Gantt chart
« Reply #1 on: September 09, 2020, 11:55:00 am »
I see that CodeTyphon has jvtfgantt unit in pl_jvcl.

It seams to be converted from this:
https://wiki.delphi-jedi.org/wiki/JVCL_Help:JvTFGantt.pas

You may try to convert that CodeTyphon component with ct2laz.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

paweld

  • Hero Member
  • *****
  • Posts: 970
Re: Gantt chart
« Reply #2 on: September 09, 2020, 12:08:53 pm »
Best regards / Pozdrawiam
paweld

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Gantt chart
« Reply #3 on: September 09, 2020, 12:37:24 pm »
or get jvcllaz from CCR: https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/jvcllaz/

Are you sure that CCR has converted jvtfgantt from Delphi JVCL?
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Gantt chart
« Reply #4 on: September 09, 2020, 01:47:01 pm »
I ported the JVCL TimeFrameworkComponents to which the JvTFGantt belongs, but my impression was that the Gantt chart is far from complete and thus dropped the component. If I the CT port proves me to be wrong (and somebody show me an example how to use it) I'd be glad to look at it again.

I think the basic elements for a Gantt chart are available in TAChart (except for the connecting lines and arrows): Do a BarSeries and rotate the bars to be horizontal. Use two y values for the bars - these correspond to the start and duration of each task. Use stacked mode. Set the brush of the 1st bar to bsClear to hide it. -- If needed I can work out an example.
« Last Edit: September 09, 2020, 03:26:08 pm by wp »

rumen-lazarus

  • Newbie
  • Posts: 3
Re: Gantt chart
« Reply #5 on: September 09, 2020, 02:17:11 pm »
This is my hack. Gantt based on TBoxAndWhiskerSeries.
Not perfect, but it works.
You can use it at least as an idea.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Gantt chart
« Reply #6 on: September 09, 2020, 03:25:23 pm »
Here is my solution using a bar series and a line series (for the "start" and "finished" dates). Most of the code shown can be done in the object inspector, but I left it to show the steps to be taken.

usbdoo

  • New Member
  • *
  • Posts: 11
Re: Gantt chart
« Reply #7 on: September 10, 2020, 04:13:26 pm »

Thanks.
You all helped me a lot.

usbdoo

  • New Member
  • *
  • Posts: 11
Re: Gantt chart
« Reply #8 on: September 17, 2020, 07:24:09 am »
Here is my solution using a bar series and a line series (for the "start" and "finished" dates). Most of the code shown can be done in the object inspector, but I left it to show the steps to be taken.

How get  hint and click  on
Chart1BarSeries1 and Chart1LineSeries1  ?
« Last Edit: September 17, 2020, 07:33:55 am by usbdoo »

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Gantt chart
« Reply #9 on: September 17, 2020, 12:56:05 pm »
I modified the demo of reply #6 (isn't your upload in the previous post the same?) to employ ChartTools for showing a hint and doing something when clicking a bar (or the start/end diamond).

See https://wiki.lazarus.freepascal.org/TAChart_Tutorial:_Chart_Tools#Using_a_TDataPointClickTool for a tutorial. There is also an example in folder components/tachart/demo/barseriestools of your Lazarus installation.

Please note that the current release version of TAChart contains a bug which prevents detection of the stacked bar clicked. The fix is simple: Open the file TASeries.pas in folder components/tachart of your Lazarus installation. Find the implementation of the function TBarSeries.GetNearestPoint. Towards the end of the function there is a loop "for stackindex := 0 to High(height)". Inside this loop you find the line
Code: Pascal  [Select][+][-]
  1. AResults.FValue := DoublePoint(Source[pointIndex]^.X, Source[pointindex]^.GetY(stackIndex));  
Immediately after this line, add
Code: Pascal  [Select][+][-]
  1. if FStacked and (stackIndex > 0) then
  2.   AResults.FValue.Y := AResults.FValue.Y + heights[stackIndex];
Recompile the TAChartLazarusPkg (or the IDE), and the demo should work.

Mimmo

  • New Member
  • *
  • Posts: 21
Re: Gantt chart
« Reply #10 on: September 17, 2020, 04:04:38 pm »
Hi,
sometimes ago I've started working on a gantt chart component.
It is unfinished even if something is working. No idea if enough for you.
The timeruler component is quite usable.
Source code is on github https://github.com/DomenicoMammola/OboCL

matthius

  • Full Member
  • ***
  • Posts: 155
  • Creating VRAD...
    • LIBERLOG - Développement rapide
Re: Gantt chart
« Reply #11 on: January 23, 2021, 09:55:33 am »
Have a look here :
https://sourceforge.net/projects/obo-components-library/files/

I am creating real Gantt Chart.

Have a look at XML Frames :
www.xmlframes.com
« Last Edit: January 23, 2021, 09:58:37 am by matthius »
M. GIROUX
13 rue Tanguy PRIGENT
35000 RENNES - France
(33)(0)2 23 46 06 54
http://liberlog.fr

Mimmo

  • New Member
  • *
  • Posts: 21
Re: Gantt chart
« Reply #12 on: January 25, 2021, 08:45:38 am »
Hi,
happy to see that you are working on my components even if you are creating a derived project on sourceforce using mercurial as scm system instead of working on a fork on github.
However I will check your work and will try to cherry pick any good idea that could be useful for my components. My idea is to build a kind of framework (dynamic multi-reports system with master-detail links, db grids with enhancements, virtual datasets, calendar controls, ecc...) and it's quite far away from your, to have a self-contained component. Anyway both approaches are good, it depends on what you need.
I've just one request: could you please add a link to the original project on github in the readme file and in the main page of the project? I will do the same on github.
Thanks,
Domenico

matthius

  • Full Member
  • ***
  • Posts: 155
  • Creating VRAD...
    • LIBERLOG - Développement rapide
Re: Gantt chart
« Reply #13 on: February 21, 2021, 03:07:42 pm »
I just want to set labels on Gantt Graph.
M. GIROUX
13 rue Tanguy PRIGENT
35000 RENNES - France
(33)(0)2 23 46 06 54
http://liberlog.fr

matthius

  • Full Member
  • ***
  • Posts: 155
  • Creating VRAD...
    • LIBERLOG - Développement rapide
Re: Gantt chart
« Reply #14 on: February 21, 2021, 04:23:58 pm »
I will test more but caption is in it.
M. GIROUX
13 rue Tanguy PRIGENT
35000 RENNES - France
(33)(0)2 23 46 06 54
http://liberlog.fr

 

TinyPortal © 2005-2018