Datatype
- Tim Schauder
- Fynn Grandke (Unlicensed)
Class graphomate.ui.Datatype
extends sap.ui.core.Element
Quick Start
Creates a datatype definition used to specify the appearance of diagram elements. Datatypes can be added directly to some diagram aggregations or to the aggregation "datatypes" of the graphomate.ui.DatatypeDictionary which provides them to any diagram on the page.
var datatypeDictionary = new graphomate.ui.DatatypeDictionary({ datatypes: [ new graphomate.ui.Datatype({ name: "sample", color: "#FF0000", fillType: graphomate.ui.enums.FillType.HatchedUp }) ] }); var chart = new graphomate.ui.charts.Chart({ chartType: graphomate.ui.charts.enums.ChartType.Bar, series1: [10, 12, 15], datatypes1: ["sample","sample","sample"] });
Constructor Details
new graphomate.ui.Datatype(id?:string, settings?:object)
Accepts an id and a settings object or one or none of them. The settings object defines initial property values. Every setting can also be set using the related setter method. The supported settings are:
Properties:
- name : string (default: "AC")
- color : graphomate.ui.types.HexColor (default: "#222222")
- shape : graphomate.ui.enums.Shape (default: Rect)
- thickness : graphomate.ui.types.UnsignedInteger (default: 1)
- fillType : graphomate.ui.enums.FillType (default: Filled)
- barWidth : graphomate.ui.types.PositiveFloat (default: 0.4)
- pinWidth : graphomate.ui.types.PositiveFloat (default: 0.25)
- fontWeigtht : graphomate.ui.enums.FontWeight (default: Normal)
Property Details
Each property "sampleProperty" can be set using the related setter "setSampleProperty". Each setter expects a valid value for the related property as input parameter and throws an exception for invalid values. It returns the "this context" for method chaining. Each property "sampleProperty" can also be gotten using the related getter method "getSampleProperty". It expects no input parameters and returns the current value of the related property. Each property that represents or partially contains indices excepts a 0 based index.
The following properties are available:
Property Name | Type | Description |
---|---|---|
name | string | Sets the name of the datatype that can be used to reference it in diagram properties. |
color | graphomate.ui.types.HexColor | Color of the element the datatype gets applied to. |
shape | graphomate.ui.enums.Shape | Shape of special markers like pin heads or line chart dots. |
thickness | graphomate.ui.types.UnsignedInteger | Border thickness of elements the datatype gets applied to. |
fillType | graphomate.ui.enums.FillType | Fill pattern of elements the datatype gets applied to. |
barWidth | graphomate.ui.types.PositiveFloat | Width of a diagram's bars. If the value is greater than 1, it will be interpreted as px. Floating point numbers between 0 and 1 will be interpreted as relative values. The resulting width will then be a share of the category width. |
pinWidth | graphomate.ui.types.PositiveFloat | Width of a diagram's pin lines. If the value is greater than 1, it will be interpreted as px. Floating point numbers between 0 and 1 will be interpreted as relative values. The resulting width will then be a share of the category width. |
fontWeight | graphomate.ui.enums.FontWeight | Emphasis of the labels of elements the datatype gets applied to. |