Class: Bar3D

SuperMap.Feature.Theme.Bar3D

3D Bar graph

new SuperMap.Feature.Theme.Bar3D(data, layer, fields, setting, lonlat)

Bar3D.js, line 7
Name Type Description
data SuperMap.Feature.Vector

User data,required parameter.

layer SuperMap.Layer.Graph

The layer thematic elements in,required parameter.

fields Array.<string>

data ields name that generate graph,required parameter.

setting SuperMap.Feature.Theme.Bar3D.setting

Graph configure object,required parameter.

lonlat SuperMap.LonLat optional

Location of thematic elements,default is the geographical elements bound center that data refer to.

Examples
// The usage of the barStyleByCodomain parameters is as follows:
// barFaceStyleByCodomain Each element is an object containing information and domain and range corresponding to the style information, the object has three properties (must):
// start: range lower limit (included);
// end: range upper limit (not included);
// style: Data visualization graphics style, this style object can be set properties: .
// barFaceStyleByCodomain array like:
[
  {
    start:0,
    end:250,
    style:{
         fillColor:"#00CD00"
     }
 },
  {
    start:250,
    end:500,
    style:{
         fillColor:"#00EE00"
     }
 },
  {
    start:500,
    end:750,
    style:{
         fillColor:"#00FF7F"
     }
 },
  {
    start:750,
    end:1500,
    style:{
         fillColor:"#00FF00"
     }
 }
]
// barSideStyleByCodomain parameters is as follows:
// barSideStyleByCodomain Each element is an object containing information and domain and range corresponding to the style information, the object has three properties (must):
// range lower limit (included);
// range upper limit (not included);
// style: Data visualization graphics style, this style object can be set properties: .
// barSideStyleByCodomain array like:
[
  {
    start:0,
    end:250,
    style:{
         fillColor:"#00CD00"
     }
 },
  {
    start:250,
    end:500,
    style:{
         fillColor:"#00EE00"
     }
 },
  {
    start:500,
    end:750,
    style:{
         fillColor:"#00FF7F"
     }
 },
  {
    start:750,
    end:1500,
    style:{
         fillColor:"#00FF00"
     }
 }
]
// The usage of the barTopStyleByCodomain parameters is as follows:
// Each element of barTopStyleByCodomain is an object that contains range information and style information corresponding to the range. The object (must) has three attributes:
// start: Start: the lower limit of the range value (inclusive);
// end: range upper limit (not included);
// style: Data visualization graphics style, this style object can be set properties: .
// barTopStyleByCodomain array like:
[
  {
    start:0,
    end:250,
    style:{
         fillColor:"#00CD00"
     }
 },
  {
    start:250,
    end:500,
    style:{
         fillColor:"#00EE00"
     }
 },
  {
    start:500,
    end:750,
    style:{
         fillColor:"#00FF7F"
     }
 },
  {
    start:750,
    end:1500,
    style:{
         fillColor:"#00FF00"
     }
 }
]

Extends

Members

chartBoundsSuperMap.Bounds

The bounds of the chart will be updated with lonlat, XOffset and YOffset, note: chartBounds is pixel range, not geographical range.

chartBoxArray.<number>

The thematic feature (chart) area, that is, the chart box, a one-dimensional array of length 4, the four elements of the array sequentially represent the x coordinate value at the left end of the chart frame,
the lower y coordinate value, the right end x coordinate value, and the upper y coordinate value; [left , bottom, right, top].

dataObject

{ReadOnly} User data, used to generate visible shape, and can define data format and type in the sub class. e.g.: <SuperMap.Feature.Vector> 。

dataValuesArray.<number>

Data values for representation, got by fields from the property of feature.

dataViewBoxArray.<number>

Data view frame parameters, an array with the length of 4(array element value >= 0), [left, bottom, right, top]. DataViewBox is the core content of the graph theme element. It is responsible for the interpretation of data visualization in a pixel region for the data, and the meaning is expressed by visual graphic. The graphics which represent the data and some auxiliary graphics are combined together to form a statistical thematic charts.

DVBCenterPointArray.<number>

Center of the data view frame, an array with the length of 2, the first one means x, the second one means y.

DVBCodomainArray.<number>

Data domain to show in the data view frame, an array with the length of 2, the first one means the minimum, the second one means the maximum. The processing for the data out of the range should be in assembleShapes.

DVBHeightnumber

Height of the data view frame.

DVBOrigonPointArray.<number>

Origin point of the data view frame, that is the upper left corner point, an array with the length of 2, the first one means x, the second one means y.

DVBParameterArray.<number>

Data view frame parameters, an array with the length of 4(array element value >= 0), [leftOffset, bottomOffset, rightOffset, topOffset], the inner offset value of chartBox. The property is used to specify the range of dataViewBox.

DVBUnitValuestring

Unit value. Initialized in assembleShapes(), e.g.:DVBUnitValue of the pie chart is ”360/data count value”, DVBUnitValue of the line chart is “DVBCodomain/DVBHeight”.

DVBWidthnumber

Width of the data view frame.

fieldsArray.<string>

The data {SuperMap.Feature.Vector} attribute fields.

heightnumber

Height of the theme elements(chart), required.

idstring

Unique identification of thematic elements

layerSuperMap.Layer.Theme

{ReadOnly} Thematic layer where thematic features are.

locationArray

Thematic feature pixel reference position. In general, it is determined by geographic reference. It is an array, the first element is x coordinate, and the second element is y coordinate.

Thematic feature geographic reference position. In sub class, it is assigned by user data (or geographic position parameter).

origonPointArray.<number>

Origin point of the theme elements(chart), that is the upper left corner point, an array with the length of 2, the first one means x, the second one means y.

origonPointOffsetArray.<number>

The origin offset of the data view box relative to the chart box is 2 dimensional array, the first element represents the X offset, and the second element represents the Y offset.

RelativeCoordinateboolean

Whether the figure has been calculated for the relative coordinates.

settingObject

Graph configuration object, which controls the visual display of the graph.

The embedded shape factory object, call its createShape method to create shapes.

shapeParametersObject

The current shape parameter object, the subclass object of <SuperMap.Feature.ShapeParameters>.

shapesArray

{ReadOnly} The visible shape array by thematic features. The order of the array controls the render.

widthnumber

Width of the theme elements(chart), required.

XOffsetnumber

Offset in X direction of the theme elements(chart), the unit is pixel.

YOffsetnumber

Offset in Y direction of the theme elements(chart), the unit is pixel.

Methods

assembleShapes()

Bar3D.js, line 150

Graphic assembly function.

calculateXShapeInfo(){Object}

Bar3D.js, line 331

calculate the graphic information on the X axis, this information is an object that contains two properties, property xPositions is a one-dimensional array that represents the pixel coordinates of the pattern in the X axis direction, if the graph has a certain width in the X direction, usually the center point of the graph in the X direction is the coordinate value of the figure in the X direction. width represents the width of the graph (special attention: the width of the point is always 0, not its diameter). graphical configuration object setting in this function can be set to properties:
xShapeBlank - {Array} xShapeBlank horizontal direction on the graph blank interval parameters. length for 3 of the array, the first element is the blank space between left of first figure and the left end of the data view box, the second element is the blank space between graphics. third elements that represent the end of the right end of the graph and the blank space between the right end of the data view.

Returns:
Type Description
Object If the calculation fails, return null; if successful, return to the X axis direction of the graphics information, this information is an object that contains the following two properties:
xPositions - {Array} said graphics on the X axis coordinates of the pixel value, if graphics in the X direction with a certain width, usually graphics in the X direction the center point of the graphics in the X direction coordinate value.
width - {number} width represents the width of the graph (special note: the width of the point is always 0, not its diameter).

inherited constructor(data, layer){SuperMap.Feature.Theme}

Theme.js, line 14

The Constructor.

Name Type Description
data Object

User data which is used to generate visible shape. Required.

layer SuperMap.Layer.Theme

The layer the theme element is in, required.

Returns:
Type Description
SuperMap.Feature.Theme Return a thematic feature.

inherited destroy()

Graph.js, line 208

Destroys thematic features.

inherited destroy()

Graph.js, line 208

Destroys thematic features.

inherited getLocalXY(lonlat)

Graph.js, line 465

The geographic coordinates are converted to pixel coordinates.

Name Type Description
lonlat SuperMap.Lonlat

The geographical coordinates to be converted.

Returns:
Screen pixel coordinates.

inherited initBaseParameter(width, height, codomain, XOffset, YOffset, dataViewBoxParameter, decimalNumber){boolean}

Graph.js, line 238

Initialize the basic parameters of the theme element (chart). Before calling this method, the graph model related properties are not available, this method is called in the assembleShapes function.
The related properties of the setting object are:

Name Type Description
width number

Width of the theme elements(chart), required.

height number

Height of the theme elements(chart), required.

codomain Array.<number>

Domain, an array with the length of 2, the first one is the minimum, the second one is the maximum value, required.

XOffset number optional

Offset in X direction of the theme elements(chart), the unit is pixel.

YOffset number optional

Offset in Y direction of the theme elements(chart), the unit is pixel.

dataViewBoxParameter Array.<number> optional

The data view frame dataViewBox parameters,
means four inner offset values in left, down, right, up direction of chartBox( constituted by chart position, chart width, chart height).

decimalNumber number optional

The decimal value of the data value array dataValues, decimal processing parameters, the range is: [0, 16]. If you do not set this parameter, the decimal will not be processed.

Returns:
Type Description
boolean Whether the initialization is successful.

inherited resetLinearGradient()

Graph.js, line 367

When the relative coordinates of the chart are called in the resetLocation, the color of the gradient is recalculated.(The subclass implements this method at present for the gradient color of a two-dimensional histogram)

inherited resetLocation(lonlat){Array.<number>}

Graph.js, line 336

The location of the thematic element (Chart) is reset according to the geographic location lonlat.

Name Type Description
lonlat SuperMap.LonLat

The new pixel center position of the feature element.

Returns:
Type Description
Array.<number>
  • New feature element pixel reference position. The length of an array is 2, the first element to represent the X coordinates, the second elements to represent the Y coordinates.

inherited shapesConvertToRelativeCoordinate()

Graph.js, line 375

The node that will (constitute a graph) is converted to relative coordinates, which must be called at the end of the assembleShapes ().

Type Definitions

SuperMap.Feature.Theme.Bar3D.settingObject

Properties:
Name Type Default Description
width number

Thematic elements (Graph) width, required parameters.

height number

Thematic elements (Graph) height, required parameters.

codomain Array.<number>

Charts allow the display of the data range, the length of two one-dimensional arrays, the first element is range lower limit, the second element is range limit, required parameters.

XOffset number optional

Thematic elements (Graph) width, required parameters.

YOffset number optional

Thematic elements (Graph) height, required parameters.

dataViewBoxParameter Array.<number> optional

Charts allow the display of the data range, the length of two one-dimensional arrays, the first element is range lower limit, the second element is range limit, required parameters.

decimalNumber number optional

Data value array dataValues elements of the decimal value, the decimal processing parameters of data, range: [0, 16]. If you do not set this parameter in data value is not a digital data processing.

useBackground boolean true optional

Whetjer to use Background box, the default is true.

backgroundStyle SuperMap.Feature.ShapeParameters.Rectangle.style optional

Background style.

backgroundRadius Array.<number> [0, 0, 0, 0] optional

Rectangular corner radius of the background frame, you can use the array to specify the four corners of the fillet radius,Set: the radius of upper left, upper right, lower left and lower left corner in turn is: r1、r2、r3、r4, backgroundRadius is [r1、r2、r3、r4 ],default [0, 0, 0, 0]. xShapeBlank - {Array} Blank space parameters in horizontal direction.

xShapeBlank Array.<number> optional

xShapeBlank horizontal direction on the graph blank interval parameters.

bar3DParameter number 10 optional

3D bar parameter, the 3D column positive direction relative to the back direction of the X axis and the Y axis.

useAxis boolean true optional

Whether to use axis,default is true.

axisStyle SuperMap.Feature.ShapeParameters.Line.style optional

Coordinate axis style.

axisUseArrow boolean true optional

Whether to use arrow axis.

axisYTick number 0 optional

Y axis scale.

axisYLabels Array.<string> optional

The contents of the label group on the y-axis, the label order is arranged from the top to the bottom of the left side of the data view box, equidistantly arranged. For example: ["1000", "750", "500", "250", "0"].

axisYLabelsStyle SuperMap.Feature.ShapeParameters.Label.style optional

The label group style on the y-axis.

axisYLabelsOffset Array.<number> 0 optional

The label group offset on the y-axis. An array of length 2, the first item of the array represents the offset in the horizontal direction of the y-axis label group, positive to the left, default value: 0; the second item of the array represents the offset in the longitudinal direction of the y-axis label group, down Positive.

axisXLabels Array.<string> optional

X axis label group content and sequence tagged along the data view box below edges from left to right arrangement.For example["92", "95", "99"].Label arrangement of rules: when the number of attribute xShapeCenter tag number and xShapeInfo same (i.e. label a number of data and is equal to the number of), in accordance with xShapeCenter position arrangement of tags. Or along the dataView box below the edge label equidistant arrangement.

axisXLabelsStyle SuperMap.Feature.ShapeParameters.Label.style

The label group style on the x-axis.

axisXLabelsOffset Array.<number>

The label group offset on the x-axis. An array of length 2, the first item of the array represents the offset in the horizontal direction of the x-axis label group, positive to the left, default value: -10; the second item of the array represents the offset in the longitudinal direction of the x-axis label group, The next is positive.

useXReferenceLine boolean optional

Whether to use a horizontal reference line, if true, is valid when axisYTick is greater than 0, and the horizontal reference line is the extension of the y-axis scale in the data view box.

xReferenceLineStyle SuperMap.Feature.ShapeParameters.Line.style optional

Horizontal guide style.

axis3DParameter number 20 optional

3D axis parameter, this attribute value is valid when it is greater than or equal to 15.

barFaceStyle SuperMap.Feature.ShapeParameters.Polygon.style

3d Histogram bar front base style, this parameter controls the front base style of the bar, with priority lower than barFaceStyleByFields and barFaceStyleByCodomain.

barFaceStyleByFields Array.<SuperMap.Feature.ShapeParameters.Polygon.style> optional

Press the theme field themeFields(<SuperMap.Layer.Graph.themeFields>) to assign style to the front of the bar. This parameter controls the front style of the bar by field, with priority lower than barFaceStyleByCodomain and higher than barFaceStyle. The elements in this array are style objects. The style in this parameter corresponds to the fields in themeFields one by one. E.g: themeFields(<SuperMap.Layer.Graph.themeFields>) For ["POP_1992", "POP_1995", "POP_1999"], and barFaceStyleByFields is [style1, style2, style3], in the chart, style1 is used on the front of the bar corresponding to the field POP_1992, and style2 is used on the front of the bar corresponding to the field POP_1995. Style3 is used on the front of the bar corresponding to field POP_1999.

barFaceStyleByCodomain Array.<Object> optional

Controls the front style of the bar by the range of values of the data values represented by the front of the bar, with priority over barFaceStyle and barFaceStyleByFields.

barSideStyle SuperMap.Feature.ShapeParameters.Polygon.style barFaceStyle optional

3d Histogram column side base style, this parameter controls the base style of the bar side, with priority lower than barSideStyleByFields and barSideStyleByCodomain.

barSideStyleByFields Array.<SuperMap.Feature.ShapeParameters.Polygon.style> optional

Press the theme field themeFields(<SuperMap.Layer.Graph.themeFields>) to assign style to the side of the bar. This number controls the side style of the bar by field, and the priority is lower than barSideStyleByCodomain, higher than barSideStyle.The elements in this array are style objects. The style in this parameter corresponds to the fields in themeFields one by one.E.g:themeFields(<SuperMap.Layer.Graph.themeFields>) It is ["POP_1992", "POP_1995", "POP_1999"],barSideStyleByFields for [style1, style2, style3],In the chart, style1 is used on the side of the column corresponding to the field POP_1992, style2 is used on the side of the column corresponding to the field POP_1995, and style3 is used on the side of the column corresponding to the field POP_1999. Default: barFaceStyleByFields.

barSideStyleByCodomain Array.<Object> barFaceStyleByCodomain optional

Controls the side style of the bars by the range of values of the data values represented by the sides of the bars, with priority over barSideStyle and barSideStyleByFields.

barFaceHoverStyle Object optional

3d bar front hover state style, valid when barHoverAble is true.

barSideHoverStyle Object barFaceHoverStyle optional

The style of the 3d bar side hover state, valid when barHoverAble is true.

barTopHoverStyle Object barFaceHoverStyle optional

The style of the 3d bar top hover state, valid when barHoverAble is true.

barHoverAble boolean true optional

Whether to allowe the bar to use the hover state, the default is allowed. At the same time, set the barHoverAble and barClickAble false, can be directly on the shielding column thematic layer event response.<

barClickAble boolean true optional

Whether to allowe the bar is clicked, the default is allowed. At the same time, barHoverAble and barClickAble are set to false, which can directly screen the response of the column strip to the event layer.<

barTopStyle SuperMap.Feature.ShapeParameters.Polygon.style barFaceStyle optional

3d Histogram bar top base style, this parameter controls the top style of the bar top, with priority lower than barTopStyleByFields and barTopStyleByCodomain.

barTopStyleByFields Array.<SuperMap.Feature.ShapeParameters.Polygon.style> barFaceStyleByFields optional

According to the theme field themeFields(<SuperMap.Layer.Graph.themeFields>), assign the style to the top of the bar. This parameter controls the top style of the bar by field, and the priority is lower than barTopStyleByCodomain, higher than barTopStyle. The elements in this array are style objects. In this parameter.The style in this parameter corresponds to the fields in themeFields one by one.For example: themeFields(<SuperMap.Layer.Graph.themeFields>) is ["POP_1992", "POP_1995", "POP_1999"], and barTopStyleByFields is [style1, style2, style3],In the chart, the top of the bar corresponding to the field POP_1992 uses style1, the top of the bar corresponding to the field POP_1995 uses style2, and the top of the bar corresponding to the field POP_1999 uses style3.

barTopStyleByCodomain Array.<Object> barFaceStyleByCodomain optional

Controls the top style of the bar by the range of values of the data values represented by the top surface of the bar, with priority over barTopStyle and barTopStyleByFields.