tooltip font

Specifies font options for the text displayed by the tooltip.

Type: Object

Show Example:
jQuery

In this example, several font options of the tooltip text are changed.

<div id="sparklineContainer" style="height:50px;max-width:200px;margin: 0 auto;padding-top:90px;position:relative"></div>
var silverCosts = [
    { month: 1, 2010: 17 }, { month: 2, 2010: 28 },
    { month: 3, 2010: 34 }, { month: 4, 2010: 37 },
    { month: 5, 2010: 47 }, { month: 6, 2010: 37 },
    { month: 7, 2010: 34 }, { month: 8, 2010: 40 },
    { month: 9, 2010: 41 }, { month: 10, 2010: 30 },
    { month: 11, 2010: 34 }, { month: 12, 2010: 32 }
]

$(function () {
    $('#sparklineContainer').dxSparkline({
        dataSource: silverCosts,
        argumentField: 'month',
        valueField: '2010',
        type: 'area',
        lineColor: 'indianred',
        showFirstLast: false,
        tooltip: {
            font: {
                color: 'lemonchiffon',
                size: 10,
                family: 'Zapf-Chancery, cursive',
                opacity: 0.7,
                weight: 700
            }
        }
    });
})

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 color option of the tooltip text is changed to cornflowerblue.

<div id="sparklineContainer" style="height:50px;max-width:200px;margin: 0 auto;padding-top:90px;position:relative"></div>
var silverCosts = [
    { month: 1, 2010: 17 }, { month: 2, 2010: 28 },
    { month: 3, 2010: 34 }, { month: 4, 2010: 37 },
    { month: 5, 2010: 47 }, { month: 6, 2010: 37 },
    { month: 7, 2010: 34 }, { month: 8, 2010: 40 },
    { month: 9, 2010: 41 }, { month: 10, 2010: 30 },
    { month: 11, 2010: 34 }, { month: 12, 2010: 32 }
]

$(function () {
    $('#sparklineContainer').dxSparkline({
        dataSource: silverCosts,
        argumentField: 'month',
        valueField: '2010',
        type: 'area',
        lineColor: 'teal',
        showFirstLast: false,
        tooltip: {
            font: {
                color: 'cornflowerblue'
            }
        }
    });
})

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 family option of the tooltip text is changed.

<div id="sparklineContainer" style="height:50px;max-width:200px;margin: 0 auto;padding-top:90px;position:relative"></div>
var silverCosts = [
    { month: 1, 2010: 17 }, { month: 2, 2010: 28 },
    { month: 3, 2010: 34 }, { month: 4, 2010: 37 },
    { month: 5, 2010: 47 }, { month: 6, 2010: 37 },
    { month: 7, 2010: 34 }, { month: 8, 2010: 40 },
    { month: 9, 2010: 41 }, { month: 10, 2010: 30 },
    { month: 11, 2010: 34 }, { month: 12, 2010: 32 }
]

$(function () {
    $('#sparklineContainer').dxSparkline({
        dataSource: silverCosts,
        argumentField: 'month',
        valueField: '2010',
        type: 'area',
        lineColor: 'darkviolet',
        showFirstLast: false,
        tooltip: {
            font: {
                family: 'Zapf-Chancery, cursive'
            }
        }
    });
})

opacity

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

Type: Number
Default Value: undefined

Show Example:
jQuery

In this example, the opacity option of the tooltip text is set to 0.5.

<div id="sparklineContainer" style="height:50px;max-width:200px;margin: 0 auto;padding-top:90px;position:relative"></div>
var silverCosts = [
    { month: 1, 2010: 17 }, { month: 2, 2010: 28 },
    { month: 3, 2010: 34 }, { month: 4, 2010: 37 },
    { month: 5, 2010: 47 }, { month: 6, 2010: 37 },
    { month: 7, 2010: 34 }, { month: 8, 2010: 40 },
    { month: 9, 2010: 41 }, { month: 10, 2010: 30 },
    { month: 11, 2010: 34 }, { month: 12, 2010: 32 }
]

$(function () {
    $('#sparklineContainer').dxSparkline({
        dataSource: silverCosts,
        argumentField: 'month',
        valueField: '2010',
        type: 'splinearea',
        lineColor: 'peru',
        showFirstLast: false,
        tooltip: {
            font: {
                opacity: 0.5
            }
        }
    });
})

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 size option of the tooltip text is changed to 9.

<div id="sparklineContainer" style="height:50px;max-width:200px;margin: 0 auto;padding-top:90px;position:relative"></div>
var silverCosts = [
    { month: 1, 2010: 17 }, { month: 2, 2010: 28 },
    { month: 3, 2010: 34 }, { month: 4, 2010: 37 },
    { month: 5, 2010: 47 }, { month: 6, 2010: 37 },
    { month: 7, 2010: 34 }, { month: 8, 2010: 40 },
    { month: 9, 2010: 41 }, { month: 10, 2010: 30 },
    { month: 11, 2010: 34 }, { month: 12, 2010: 32 }
]

$(function () {
    $('#sparklineContainer').dxSparkline({
        dataSource: silverCosts,
        argumentField: 'month',
        valueField: '2010',
        type: 'steparea',
        lineColor: 'darkseagreen',
        showFirstLast: false,
        tooltip: {
            font: {
                size: 9
            }
        }
    });
})

weight

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

Type: Number
Default Value: 400

Show Example:
jQuery

In this example, the weight option of the tooltip text is changed to 700.

<div id="sparklineContainer" style="height:50px;max-width:200px;margin: 0 auto;padding-top:90px;position:relative"></div>
var silverCosts = [
    { month: 1, 2010: 17 }, { month: 2, 2010: 28 },
    { month: 3, 2010: 34 }, { month: 4, 2010: 37 },
    { month: 5, 2010: 47 }, { month: 6, 2010: 37 },
    { month: 7, 2010: 34 }, { month: 8, 2010: 40 },
    { month: 9, 2010: 41 }, { month: 10, 2010: 30 },
    { month: 11, 2010: 34 }, { month: 12, 2010: 32 }
]

$(function () {
    $('#sparklineContainer').dxSparkline({
        dataSource: silverCosts,
        argumentField: 'month',
        valueField: '2010',
        type: 'area',
        lineColor: 'sandybrown',
        showFirstLast: false,
        tooltip: {
            font: {
                weight: 700
            }
        }
    });
})