Class: GanttChart

GanttChart

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 59

GanttChart plugin enables a possibility to create a Gantt chart using a Handsontable instance.
In this case, the whole table becomes read-only.

Example
ganttChart: {
    dataSource: data,
    firstWeekDay: 'monday', // sets the first day of the week to either 'monday' or 'sunday'
    startYear: 2015 // sets the displayed year to the provided value
  }

// Where data can be either an data object or an object containing information about another Handsontable instance, which
// would feed the chart-enabled instance with data.
// For example:

// Handsontable-binding information
var data = {
  instance: source, // reference to another Handsontable instance
  startDateColumn: 4, // index of a column, which contains information about start dates of data ranges
  endDateColumn: 5, // index of a column, which contains information about end dates of data ranges
  additionalData: { // information about additional data passed to the chart, in this example example:
    label: 0, // labels are stored in the first column
    quantity: 1 // quantity information is stored in the second column
  },
  asyncUpdates: true // if set to true, the updates from the source instance with be asynchronous. Defaults to false.
}

// Data object
var data = [
  {
    additionalData: {label: 'Example label.', quantity: 'Four packs.'},
    startDate: '1/5/2015',
    endDate: '1/20/2015'
  },
  {
    additionalData: {label: 'Another label.', quantity: 'One pack.'},
    startDate: '1/11/2015',
    endDate: '1/29/2015'
  }
];

Members

colorDataObject

Color information set after applying colors to the chart.

currentYearNumber

Currently loaded year.

dataFeedObject

Data feed controller for this plugin.

dateCalculatorObject

Date Calculator object.

hotSourceObject

Object containing properties of the source Handsontable instance (the data source).

initialSettingsObject

Initial instance settings - used to rollback the gantt-specific settings during the disabling of the plugin.

monthHeadersArrayArray

Array of data for the month headers.

monthListArray

List of months and their corresponding day counts.

nestedHeadersPluginObject

Reference to the Nested Headers plugin.

overallWeekSectionCountNumber

Number of week 'blocks' in the nested headers.

rangeBarMetaObject

Metadata of the range bars, used to re-apply meta after updating HOT settings.

rangeBarsObject

Object containing the currently created range bars, along with their corresponding parameters.

rangeListObject

Object containing the currently created ranges with coordinates to their range bars.

settingsObject

Cached plugin settings.

weekHeadersArrayArray

Array of data for the week headers.

Methods

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 513

addRangeBar(row, startDate, endDate, additionalData){Array|Boolean}

Create a new range bar.

Parameters:
Name Type Description
row Number

Row index.

startDate Date | String

Start date object/string.

endDate Date | String

End date object/string.

additionalData Object

Additional range data.

Returns: {Array|Boolean} Array of the bar's row and column.
handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 494

applyRangeBarMetaCache()

Apply the cached cell meta.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 479

cacheRangeBarMeta(row, col, key, value)

Add rangebar meta data to the cache.

Parameters:
Name Type Description
row Number
col Number
key String
value String | Number | Object | Array
handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 160

checkDependencies()

Checks if the dependencies are met, if not, throws a warning.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 216

disablePlugin()

Disable the plugin.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 176

enablePlugin()

Enable the plugin

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 330

getRangeBarCoordinates(row){Object}

Get a range bar coordinates by the provided row.

Parameters:
Name Type Description
row Number

Range bar's row.

Returns: {Object}
handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 554

getRangeBarData(row, column){Object|Boolean}

Get the range bar data of the provided row and column.

Parameters:
Name Type Description
row Number

Row index.

column Number

Column index.

Returns: {Object|Boolean} Returns false if no bar is found.
handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 169

isEnabled()

Check if plugin is enabled

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 257

parseSettings()

Parse the plugin settings.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 662

removeAllRangeBars()

Remove all range bars from the chart-enabled Handsontable instance.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 640

removeRangeBarByColumn(row, startDateColumn)

Remove a range bar of the provided row and start column.

Parameters:
Name Type Description
row Number

Row index.

startDateColumn Number

Column index.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 628

removeRangeBarByDate(row, startDate)

Remove a range bar of the provided start date and row.

Parameters:
Name Type Description
row Number

Row index.

startDate Date | String

Start date.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 596

renderRangeBar(row, startDateColumn, endDateColumn, additionalData)

Add a range bar to the table.

Parameters:
Name Type Description
row Number

Row index.

startDateColumn Number

Start column index.

endDateColumn Number

End column index.

additionalData Object

Additional range data.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 744

setRangeBarColors(rows)

Set range bar colors.

Parameters:
Name Type Description
rows Object

Object containing row color data, see example.

Example
 hot.getPlugin('ganttChart').setRangeBarColors({
   0: ['blue', 'lightblue'] // paints the bar in the first row blue, with partial sections colored light blue
  2: ['#2A74D0', '#588DD0'] // paints the bar in the thrid row with #2A74D0, with partial sections colored with #588DD0
 });
handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 765

setYear(year)

Update the chart with a new year.

Parameters:
Name Type Description
year Number

New chart year.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 702

uniformBackgroundRenderer(instance, TD, row, col, prop, value, cellProperties)

A default renderer of the range bars.

Parameters:
Name Type Description
instance Object

HOT instance.

TD HTMLElement

TD element.

row Number

Row index.

col Number

Column index.

prop String | Number

Object data property.

value String | Number

Value to pass to the cell.

cellProperties Object

Current cell properties.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 677

unrenderRangeBar(row, startDateColumn, endDateColumn)

Remove a range bar from the table.

Parameters:
Name Type Description
row Number

Row index.

startDateColumn Number

Start column index.

endDateColumn Number

End column index.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 247

updatePlugin()

Updates the plugin to use the latest options you have specified.

handsontable-pro/src/plugins/ganttChart/ganttChart.js, line 578

updateRangeBarData(row, column, data)

Update the range bar data by the provided object.

Parameters:
Name Type Description
row Number

Row index.

column Number

Column index.

data Object

Object with the updated data.