<< Click to Display Table of Contents >>

SuperGIS Server JavaScript API

 

new sg.renderers.DotDensityRenderer(param)

 

 

Description

The DotDensityRenderer allows users to create dot density visualizations.

 

Position

Randerer.js

 

 

Properties

 

Properties

Type

Description

backgroundColor

sg.Color

圖徵背景顏色

dotShape


點的形狀

dotSize

Number

點大小(單位:pixel)

dotValue

Number

每點數值Dot value.

fields

Array.<Objects>

依據哪個欄位呈現點子圖

outline

sg.symbols.Symbol

圖徵外框

 

 

Methods

 

Methods

Type

Description

getSymbol(graphic)

graphic:sg.Graphic

Returns:sg.symbols.Symbol

Return graphic symbol.

Name

Type

Description

graphic

sg.Graphic

設定symbol

Returns:

Type

Description

sg.symbols.Symbol


setBackgroundColor(color)

sg.Color

Define the background color.

Name

Type

Description

color

sg.Color

設定背景顏色

setDotSize(size)

Number

Define the dot size.

Name

Type

Description

size

Number

點子圖大小

setDotValue(value)

Number

Define the dot value.

Name

Type

Description

value

Number

每點數值

setOutline(outline)

sg.symbols.Symbol

Define symbol outline.

Name

Type

Description

outline

sg.symbols.Symbol

圖徵外框

 

 

Example

 

 

<script type="text/javascript" src="scripts/GraphicsLayer.js"></script>

<script type="text/javascript" src="scripts/Renderer.js"></script>

<script type="text/javascript" src="scripts/Symbol.js"></script>

<script type="text/javascript" src="scripts/Graphic.js"></script>

 

//Create DotDensityRenderer

var DotDensityRenderer = new sg.renderers.DotDensityRenderer({

    dotSize: 3,

    dotValue: 3000,

    fields: [{

         name: "gdp_md_est",

         color: new sg.Color(160, 106.6, 0, 0.6)

    }]

});

 

 

 

See live example

 


©2015 Supergeo Technologies Inc.