This gives you static functions for creating dynamically sized and colored marker icons using the Charts API marker output.
This namespace contains functions that you can use to easily create dynamically sized, colored, and labeled icons.
Static Methods | Return Value | Description |
---|---|---|
createFlatIcon(opts?) |
GIcon |
Creates a flat icon based on the specified options in the
MarkerIconOptions argument.
Supported options are: width, height, primaryColor,
shadowColor, label, labelColor, labelSize, and shape.. |
createLabeledMarkerIcon(opts?) |
GIcon |
Creates a labeled marker icon based on the specified options in the
MarkerIconOptions argument.
Supported options are: primaryColor, strokeColor,
starPrimaryColor, starStrokeColor, label, labelColor, and addStar. |
createMarkerIcon(opts?) |
GIcon |
Creates an icon based on the specified options in the
MarkerIconOptions argument.
Supported options are: width, height, primaryColor,
strokeColor, and cornerColor. |
This class represents optional arguments to createMarkerIcon
,
createFlatIcon
, or createLabeledMarkerIcon
. Each of the
functions use a subset of these arguments. See the function descriptions
for the list of supported options. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.
Properties | Type | Description |
---|---|---|
addStar |
Boolean |
Specifies whether to add a star to the
edge of the icon. The default value is false . |
cornerColor |
String |
Specifies, as a hexadecimal
string, the color used for the top corner of the icon. If you'd like the
icon to have a consistent color, make the this the same as the
primaryColor . The default value is "#ffffff" . |
height |
Number |
Specifies, in pixels, the height of the icon. The default value is 32 . |
label |
String |
Specifies a character or string to display
inside the body of the icon. Generally, one or two characters looks best. The default value is "" . |
labelColor |
String |
Specifies, as a hexadecimal
string, the color used for the label text. The default value is "#000000" . |
labelSize |
Number |
Specifies, in pixels, the size of the label
text. If set to 0, the text auto-sizes to fit the icon body. The default value is 0 . |
primaryColor |
String |
Specifies, as a hexadecimal
string, the color used for the majority of the icon body. The default value is "#ff0000" . |
shadowColor |
String |
Specifies, as a hexadecimal
string, the color used for the shadow of the icon. The default value is "#000000" . |
shape |
String |
Specifies shape of the icon. Current
options are "circle" for a circle or "roundrect" for a rounded rectangle. The default value is "circle" . |
starPrimaryColor |
String |
Specifies, as a hexadecimal
string, the color used for the star body. The default value is "#FFFF00" . |
starStrokeColor |
String |
Specifies, as a hexadecimal
string, the color used for the outside line (stroke) of the star. The default value is "#0000FF" . |
strokeColor |
String |
Specifies, as a hexadecimal
string, the color used for the outside line (stroke) of the icon. The default value is "#000000" . |
width |
Number |
Specifies, in pixels, the width of the icon.
The width may include some blank space on the side, depending on the
height of the icon, as the icon will scale its shape proportionately. The default value is 32 . |