DatatypeDictionary

Class graphomate.ui.DatatypeDictionary


extends sap.ui.core.Element


Quick Start

The datatype dictionary is an element that stores graphomate.ui.Datatypes which define the appearance of diagram elements. The dictionary provides these datatypes to all graphomate diagrams which are sharing the same window object. Therefor only one instance of the DatatypeDictionary is needed. After intantiation the DatatypeDictionary has created four default datatypes in its aggregation "datatypes".

Default Datatypes of graphomate.ui.DatatypeDictionary:

namesemanticcolorshapethicknessfillTypebarWidthpinWidthfontWeight
ACActual#222222rect1filled0.40.25normal
PPPlanned#808080rhomb1filled0.40.25normal
BUBudget#000000circle1empty0.40.25normal
FCForecast#000000rhomb1hatchedUp0.40.25normal


Usage Example
var datatypeDictionary = new graphomate.ui.DatatypeDictionary();
var chart = new graphomate.ui.charts.Chart({
    chartType: graphomate.ui.charts.enums.ChartType.Bar,
    series1: [10, 12, 14, 12],
    datatypes1: ["AC","PP","BU","FC"]
});











Constructor Details

new graphomate.ui.DatatypeDictionary(id?:string, settings?:object)

Accepts an id and a settings object or one or none of them. The settings object defines aggregation values. A datatype can also be added by using the related aggregation methods. The supported settings are:

Aggregations:




Aggregation Details

Items of an aggregation named "sampleThings" that has a cardinality of 0...n (and a multiplicity of 1:n) can be accessed by using one of the following methods:

  • indexOfSampeThing(object) - Searches for the provided object in the aggregation and returns its 0-based index if found, or -1 otherwise.
  • getSampleThings() - Returns an array with the objects contained in the aggregation or an empty array.
  • addSampleThing(object) - Adds the provided object as last element in the aggregation. Returns this for method chaining.
  • insertSampleThing(object, index) - Inserts the provided object into the aggregation at position i. Returns this for method chaining.
  • removeSampleThing(object) - Removes the provided object from the aggregation. Returns the removed object.
  • removeAllSampleThings() - Removes all objects from the aggregation. Returns an array of all removed objects.
  • destroySampleThings() - Destroys all currently aggregated objects and clears the aggregation. Returns this for method chaining.


The following aggregations are available:

Aggregation NameAggregated Object TypeCardinalityDescription

datatypes

graphomate.ui.Datatype0...nThe aggregated datatypes will be provided to every graphomate diagram in the same Document Object Model (they have to share the same window object). The datatypes can be referred to by using their names in the related property value of a graphomate diagram.