tooltip font

Specifies font options for the text displayed by the tooltip.

Type: Object

Show Example:
jQuery

In this example, several font options for the tooltip text are changed. Hover over any area to see a tooltip.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var i = 0;

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/world.txt',
        areaSettings: {
            palette: 'Soft Pastel',
            paletteSize: 5,
            customize: function () {
                return {
                    paletteIndex: i++ % 5
                };
            }
        },
        tooltip: {
            enabled: true,
            customizeTooltip: function () {
                return {
                    text: this.attribute('name')
                };
            },
            font: {
                color: 'coral',
                family: 'Verdana',
                opacity: 0.6,
                size: 16,
                weight: 100
            }
        }
    });
});

color

Specifies a font color for the text displayed by the tooltip.

Type: String
Default Value: '#232323'

This option supports the following colors.

  • Hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • Predefined/cross-browser color names
  • Predefined SVG colors (not supported in Internet Explorer 8)
Show Example:
jQuery

In this example, the text displayed by tooltips is colored in 'mediumvioletred'. Hover over any area to see a tooltip.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var i = 0;

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/world.txt',
        areaSettings: {
            palette: 'Violet',
            paletteSize: 5,
            customize: function () {
                return {
                    paletteIndex: i++ % 5
                };
            }
        },
        tooltip: {
            enabled: true,
            customizeTooltip: function () {
                return {
                    text: this.attribute('name')
                };
            },
            font: {
                color: 'mediumvioletred'
            }
        }
    });
});

family

Specifies a font family for the text displayed by the tooltip.

Type: String
Default Value: "'Segoe UI', 'Helvetica Neue', 'Trebuchet MS', Verdana"

For details on acceptable values, refer to the Font family article.

Show Example:
jQuery

In this example, the font family of tooltips is changed. Hover over any area to see a tooltip.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var i = 0;

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/world.txt',
        areaSettings: {
            palette: 'Vintage',
            paletteSize: 5,
            customize: function () {
                return {
                    paletteIndex: i++ % 5
                };
            }
        },
        tooltip: {
            enabled: true,
            customizeTooltip: function () {
                return {
                    text: this.attribute('name')
                };
            },
            font: {
                family: 'Verdana'
            }
        }
    });
});

opacity

Specifies a font opacity for the text displayed by the tooltip.

Type: Number
Default Value: undefined

Show Example:
jQuery

In this example, the font opacity of tooltips is changed. Hover over any area to see a tooltip.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var i = 0;

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/world.txt',
        areaSettings: {
            palette: 'Pastel',
            paletteSize: 5,
            customize: function () {
                return {
                    paletteIndex: i++ % 5
                };
            }
        },
        tooltip: {
            enabled: true,
            customizeTooltip: function () {
                return {
                    text: this.attribute('name')
                };
            },
            font: {
                opacity: 0.4
            }
        }
    });
});

size

Specifies a font size for the text displayed by the tooltip.

Type: Number|String
Default Value: 12

For details on acceptable values, refer to the Font size article.

Show Example:
jQuery

In this example, the font size of tooltips is set to 12 using the size option. Hover over any area to see a tooltip.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var i = 0;

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/world.txt',
        areaSettings: {
            palette: 'Soft',
            paletteSize: 5,
            customize: function () {
                return {
                    paletteIndex: i++ % 5
                };
            }
        },
        tooltip: {
            enabled: true,
            customizeTooltip: function () {
                return {
                    text: this.attribute('name')
                };
            },
            font: {
                size: 12
            }
        }
    });
});

weight

Specifies a font weight for the text displayed by the tooltip.

Type: Number
Default Value: 400

Show Example:
jQuery

In this example, the font weight of tooltips is set to 700 using the weight option. Hover over any area to see a tooltip.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var i = 0;

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/world.txt',
        areaSettings: {
            palette: 'Harmony Light',
            paletteSize: 5,
            customize: function () {
                return {
                    paletteIndex: i++ % 5
                };
            }
        },
        tooltip: {
            enabled: true,
            customizeTooltip: function () {
                return {
                    text: this.attribute('name')
                };
            },
            font: {
                weight: 700
            }
        }
    });
});