Class GanttChart
Class for an object that represents a Gantt chart.
Inheritance
Inherited Members
Namespace: FastReport.BG.Gantt
Assembly: FastReport.BG.dll
Syntax
public class GanttChart : ChartBase, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable
Constructors
GanttChart()
Initialize a new instance of GanttChart
Declaration
public GanttChart()
Properties
BottomDateView
Gets or sets a lower date alignment
Declaration
public BottomDateView BottomDateView { get; set; }
Property Value
Type | Description |
---|---|
BottomDateView |
DataSource
DataSource of GanttChart
Declaration
public GanttDataSource DataSource { get; set; }
Property Value
Type | Description |
---|---|
GanttDataSource |
Remarks
When the data source changes, all nodes, including resources, will be deleted and loaded from the data source
DefaultHeaderHeight
Gets or sets a value indicating whether to use the standard header height.
Declaration
public bool DefaultHeaderHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
If the value is false, HeaderHeight property is responsible for the height of the header.
Distance
Gets or sets a value indicating the scale of dates in titles.
Declaration
public Distance Distance { get; set; }
Property Value
Type | Description |
---|---|
Distance |
DrawHorizontalGrid
Gets or sets a value indicating whether to display the horizontal grid.
Declaration
public bool DrawHorizontalGrid { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DrawVerticalGrid
Gets or sets a value indicating whether to display the vertical grid.
Declaration
public bool DrawVerticalGrid { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
HeaderHeight
Gets or sets the height of the title.
Declaration
public float HeaderHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
Header height will be applied if the property DefaultHeaderHeight is disabled
HeaderPosition
Gets or sets the position of the title relative to the chart.
Declaration
public HeaderPosition HeaderPosition { get; set; }
Property Value
Type | Description |
---|---|
HeaderPosition |
MaxLeftPartWidth
Maximum width of the block with the name of the node
Declaration
public int MaxLeftPartWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Nodes
Gets a list of records in a chart.
Declaration
public List<GanttNode> Nodes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<GanttNode> |
Palette
Chart palette
Declaration
public Palette Palette { get; }
Property Value
Type | Description |
---|---|
Palette |
Pattern
Gets or sets the template by which dates will be displayed.
Declaration
public string Pattern { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Resources
Dictionary, the key in which is the name of the resource, and the index is the index of the palette color
Declaration
public Dictionary<string, int> Resources { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Int32> |
SegmentationInHeader
Gets or sets the number of divisions in the bottom date.
Declaration
public int SegmentationInHeader { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
ShowTopDateInHeader
Gets or sets a value indicating whether to display the top date in the header.
Declaration
public bool ShowTopDateInHeader { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Styles
Get/Set Gantt Style collection
Declaration
[TypeConverter(typeof(ExpandableObjectConverter))]
public GanttStyles Styles { get; set; }
Property Value
Type | Description |
---|---|
GanttStyles |
TextOnIntervals
Gets or sets a value indicating whether to display the title of the task in the interval area.
Declaration
public bool TextOnIntervals { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
TextPosition
Specifies the position of the text relative to the spacing of the rectangle.
Declaration
public TextPosition TextPosition { get; set; }
Property Value
Type | Description |
---|---|
TextPosition |
Methods
Assign(GanttChart)
Copies parameters from the source object
Declaration
public void Assign(GanttChart source)
Parameters
Type | Name | Description |
---|---|---|
GanttChart | source | Object to copy from |
AssignResources(Dictionary<String, Int32>)
Replaces the resource dictionary with another, also changing the indices in the current nodes
Declaration
public void AssignResources(Dictionary<string, int> resources)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.Int32> | resources |
CopyNodes(List<GanttNode>)
Copies the list of nodes to another list.
Declaration
public void CopyNodes(List<GanttNode> copyTo)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<GanttNode> | copyTo | List where you want to copy the current nodes |
Remarks
The node in the list will not have an owner
CreateContextMenu()
Declaration
protected override ContextMenuStrip CreateContextMenu()
Returns
Type | Description |
---|---|
System.Windows.Forms.ContextMenuStrip |
Overrides
Draw(Graphics)
Draw the object
Declaration
public override void Draw(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g |
Overrides
GetNodeAt(Point)
Declaration
protected override NodeBase GetNodeAt(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt |
Returns
Type | Description |
---|---|
NodeBase |
Overrides
GetResourceIndex(String)
Returns and add if needed resource index depending resource name
Declaration
public int GetResourceIndex(string resourceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceName |
Returns
Type | Description |
---|---|
System.Int32 |
HandleContextPopup(Point)
Declaration
protected override bool HandleContextPopup(Point pt)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | pt |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
LoadNodes(List<GanttNode>)
Sets a list of nodes from another list
Declaration
public void LoadNodes(List<GanttNode> copyFrom)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<GanttNode> | copyFrom | List from where to load the list of nodes |
LoadNodes(Stream)
Load nodes from stream
Declaration
public void LoadNodes(Stream s)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | s | Stream |
LoadResources(Stream)
Load resources from stream
Declaration
public void LoadResources(Stream s)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | s | Stream |
SaveNodes(Stream)
Saves nodes to stream
Declaration
public void SaveNodes(Stream s)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | s | Stream |
SaveResources(Stream)
Save resources to stream
Declaration
public void SaveResources(Stream s)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | s | Stream |
Sort()
Sorts the current list of nodes by start date
Declaration
public void Sort()
ViewEquals(Object)
Returns true if the object's properties are equal
Declaration
public bool ViewEquals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Comparison object |
Returns
Type | Description |
---|---|
System.Boolean |
Events
DrawRecord
Triggers when GanttDiagram control draws the Record.
Declaration
public event GanttRecordDrawEventHandler DrawRecord
Event Type
Type | Description |
---|---|
GanttRecordDrawEventHandler |
DrawRecordInterval
Triggers when GanttDiagram control draws the Record interval.
Declaration
public event GanttRecordDrawEventHandler DrawRecordInterval
Event Type
Type | Description |
---|---|
GanttRecordDrawEventHandler |