'Timeline\gantt control in winforms approach

I want to create a control that shows a list of activities like in a gantt chart in winforms. I don't want to use any of the non official products out there. The diagram will have to:

  • Show the activities as rectangles of different colors. each activity have a start and an end date
  • Show an X-axis for the global time line reference (years, months, days)
  • Allow the user to zoom in\zoom out, changing the axis accordingly

Where should I start? I first started from scratch with an empty User Control, I can easily draw rectangle as activities but the logic of the axis and the zoom-in zoom-out feature seems too complicated to build.

An alternative could be start from a chart like an horizontal histogram and on that grid and axis draw the activities.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source