graph » options » bars » tooltip » media-rules

media-rules, mediaRules

[ root » graph » options » bars » tooltip » media-rules ]

Media rules allow for the creation of responsive charts by changing how the chart and its various objects appear at different breakpoints (or chart dimensions). You can create media rules based on the width and/or height of the chart. Try interacting with the following chart. Refer to the Media Rules Tutorial for more information.



AttributeTypeDescription
alignStringSets the alignment of the object.
Accepted Values: ['center', 'left', 'right']
alphaNumberSets the opacity on the marker, with 0 being fully transparent and 1 being fully opaque. Note that decimal value requires the leading 0.
anchorStringAllows you to set an object's anchor position
Accepted Values: ['b', 'bl', 'br', 'c', 'l', 'r', 't', 'tl', 'tr']
Default Value: 'tl'
angleNumberSets the rotation angle of the object.
Default Value: 0
backgroundClip
background-clip
BooleanClips the background image to the margins of the shape/box.
Default Value: true
backgroundColor
background-color
StringSets the background color of the object. Colors can be entered by name (e.g., "purple", "blue"), hexadecimal notation (e.g., "#666699", #33ccff"), or RGB notation (e.g., "rgb(255,0,0)", "rgb(0,0,255)")
Default Value: null
backgroundColor1
background-color-1
StringSets the first color of a 2 color background gradient of the object. To be used with background-color-2.
Default Value: null
backgroundColor2
background-color-2
StringSets the second color of a 2 color background gradient of the object. To be used with background-color-1.
Default Value: null
backgroundFit
background-fit
StringSets the direction/s on which the background image is being "stretched".
Default Value: ''
backgroundImage
background-image
StringSets a background image for the object. Value can be a local file or a web image's location. For patterns, the available patterns are: [`${string}`, 'PATTERN_BACKWARD_DIAGONAL', 'PATTERN_DARK_DOWNWARD_DIAGONAL', 'PATTERN_DARK_HORIZONTAL', 'PATTERN_DARK_UPWARD_DIAGONAL', 'PATTERN_DARK_VERTICAL', 'PATTERN_DASHED_DOWNWARD_DIAGONAL', 'PATTERN_DASHED_HORIZONTAL', 'PATTERN_DASHED_UPWARD_DIAGONAL', 'PATTERN_DASHED_VERTICAL', 'PATTERN_DIAGONAL_BRICK', 'PATTERN_DIAGONAL_CROSS', 'PATTERN_DIVOT', 'PATTERN_DOTTED_DIAMOND', 'PATTERN_DOTTED_GRID', 'PATTERN_FORWARD_DIAGONAL', 'PATTERN_HORIZONTAL', 'PATTERN_HORIZONTAL_BRICK', 'PATTERN_LARGE_CHECKER_BOARD', 'PATTERN_LARGE_GRID', 'PATTERN_LIGHT_DOWNWARD_DIAGONAL', 'PATTERN_LIGHT_HORIZONTAL', 'PATTERN_LIGHT_UPWARD_DIAGONAL', 'PATTERN_LIGHT_VERTICAL', 'PATTERN_NARROW_HORIZONTAL', 'PATTERN_NARROW_VERTICAL', 'PATTERN_OUTLINED_DIAMOND', 'PATTERN_PLAID', 'PATTERN_SHADE_25', 'PATTERN_SHADE_50', 'PATTERN_SHADE_75', 'PATTERN_SHINGLE', 'PATTERN_SMALL_CHECKER_BOARD', 'PATTERN_SMALL_GRID', 'PATTERN_SOLID_DIAMOND', 'PATTERN_SPHERE', 'PATTERN_TRELLIS', 'PATTERN_VERTICAL', 'PATTERN_WAVE', 'PATTERN_WEAVE', 'PATTERN_WIDE_DOWNWARD_DIAGONAL', 'PATTERN_WIDE_UPWARD_DIAGONAL', 'PATTERN_ZIGZAG'].
Accepted Values: ['PATTERN_BACKWARD_DIAGONAL', 'PATTERN_DARK_DOWNWARD_DIAGONAL', 'PATTERN_DARK_HORIZONTAL', 'PATTERN_DARK_UPWARD_DIAGONAL', 'PATTERN_DARK_VERTICAL', 'PATTERN_DASHED_DOWNWARD_DIAGONAL', 'PATTERN_DASHED_HORIZONTAL', 'PATTERN_DASHED_UPWARD_DIAGONAL', 'PATTERN_DASHED_VERTICAL', 'PATTERN_DIAGONAL_BRICK', 'PATTERN_DIAGONAL_CROSS', 'PATTERN_DIVOT', 'PATTERN_DOTTED_DIAMOND', 'PATTERN_DOTTED_GRID', 'PATTERN_FORWARD_DIAGONAL', 'PATTERN_HORIZONTAL', 'PATTERN_HORIZONTAL_BRICK', 'PATTERN_LARGE_CHECKER_BOARD', 'PATTERN_LARGE_GRID', 'PATTERN_LIGHT_DOWNWARD_DIAGONAL', 'PATTERN_LIGHT_HORIZONTAL', 'PATTERN_LIGHT_UPWARD_DIAGONAL', 'PATTERN_LIGHT_VERTICAL', 'PATTERN_NARROW_HORIZONTAL', 'PATTERN_NARROW_VERTICAL', 'PATTERN_OUTLINED_DIAMOND', 'PATTERN_PLAID', 'PATTERN_SHADE_25', 'PATTERN_SHADE_50', 'PATTERN_SHADE_75', 'PATTERN_SHINGLE', 'PATTERN_SMALL_CHECKER_BOARD', 'PATTERN_SMALL_GRID', 'PATTERN_SOLID_DIAMOND', 'PATTERN_SPHERE', 'PATTERN_TRELLIS', 'PATTERN_VERTICAL', 'PATTERN_WAVE', 'PATTERN_WEAVE', 'PATTERN_WIDE_DOWNWARD_DIAGONAL', 'PATTERN_WIDE_UPWARD_DIAGONAL', 'PATTERN_ZIGZAG', `${string}`]
Default Value: ''
backgroundPosition
background-position
StringSets the position of the background when the background-repeat value is no-repeat.
Default Value: '50% 50%'
backgroundRepeat
background-repeat
Boolean, StringSets the repeating mode for the background image.
Default Value: 'repeat'
backgroundScale
background-scale
NumberScales the background image using the specified ratio.
Default Value: 1
boldBooleanSets whether the text is displayed with bold characters or not.
Default Value: false
borderAlpha
border-alpha
NumberSets the transparency level of the border on the object. Values must range between 0.0 and 1.0, with 0.0 being completely transparent and 1.0 being completely opaque. Note that values require the leading 0 before the decimal point.
Default Value: 1
Introduced in: v2.1.1
borderBottom
border-bottom
NumberSets the object's bottom border style. Accepts solid, dashed, and dotted styles.
Default Value: ''
borderColor
border-color
StringSets the border color of the object.
Default Value: '#000'
borderLeft
border-left
NumberSets the object's left border style. Accepts solid, dashed, and dotted styles.
borderRadius
border-radius
NumberSets the object's border radius for rounded corners. Larger values create rounder corners, while smaller values create sharper corners. A single value will affect all 4 corners; multiple values will have separate effects on each corner, with the first value affecting the top-left corner, the second value affecting the top-right corner, and so on, in a clockwise direction. A negative value will cut a corner off without rounding.
Default Value: 0
borderRadiusBottomLeft
border-radius-bottom-left
NumberSets the object's bottom-left border radius for rounded corners. Larger values create rounder corners, while smaller values create sharper corners. A negative value will cut a corner off without rounding.
Default Value: 0
borderRadiusBottomRight
border-radius-bottom-right
NumberSets the object's bottom-right border radius for rounded corners. Larger values create rounder corners, while smaller values create sharper corners. A negative value will cut a corner off without rounding.
Default Value: 0
borderRadiusTopLeft
border-radius-top-left
NumberSets the object's top-left border radius for rounded corners. Larger values create rounder corners, while smaller values create sharper corners. A negative value will cut a corner off without rounding.
Default Value: 0
borderRadiusTopRight
border-radius-top-right
NumberSets the object's top-right border radius for rounded corners. Larger values create rounder corners, while smaller values create sharper corners. A negative value will cut a corner off without rounding.
Default Value: 0
borderRight
border-right
NumberSets the object's right border style. Accepts solid, dashed, and dotted styles.
Default Value: ''
borderTop
border-top
NumberSets the object's top border style. Accepts solid, dashed, and dotted styles.
Default Value: ''
borderWidth
border-width
NumberSets the border width of the object.
Default Value: 0
calloutBooleanSets whether an object will have a callout arrow or not.
Default Value: false
calloutExtension
callout-extension
NumberSets the length of the extension that extends beyond the tip of the callout arrow.
Default Value: 0
calloutHeight
callout-height
NumberSets the height of the object's callout arrow. A larger value will create a taller callout arrow.
Default Value: 8
calloutHook
callout-hook
Array.<Number>Sets the point of the tip of the callout arrow to a specified coordinate on the chart, with the starting point of [0,0] being the top left corner of the chart.
Default Value: null
calloutOffset
callout-offset
NumberSets the offset along the callout direction of the arrow's base. Positive and negative values can be used to offset the callout arrow up, down, left, or right depending on the callout-position.
Default Value: 0
calloutPosition
callout-position
StringSets the position for the object's callout arrow. The position is "bottom" by default.
Default Value: 'bottom'
calloutRatio
callout-ratio
Array.<Number>Sets how much to stretch/squeeze the callout arrow on its two sides. A zero value for example on one side would create like a half callout arrow. Negative values can also be set, in order to create various aspects.
Default Value: [1, 1]
calloutWidth
callout-width
NumberSets the width of the object's callout arrow. A larger value will create a wider callout arrow.
Default Value: 8
centerRef
center-ref
BooleanSets the (0,0) x/y coordinates as the center of the box (instead of the top-left corner).
Default Value: false
classStringSets a class value on the object.
Default Value: null
clipText
clip-text
BooleanTruncates text based on the setting of width.
Default Value: false
colorStringSets the object's font color. Similar to font-color.
Default Value: '#000'
dataN
data-n
AnyPrefix attribute or array using "data-" to define a custom token.
decimalsNumberSets the number of decimal places displayed for each value.
decimalsSeparator
decimals-separator
StringSets the separator to be used in place of the default decimal point. Any string or character can be used to replace the decimal.
defaultValue
default-value
StringSets the default value token values to display until the value is available.
Default Value: null
fillAngle
fill-angle
NumberSets the angle of the axis along which the linear gradient is drawn.
Default Value: 90
fillOffsetX
fill-offset-x
NumberSets an X offset to apply to the fill.
Default Value: 0
fillOffsetY
fill-offset-y
NumberSets a Y offset to apply to the fill.
Default Value: 0
fillType
fill-type
StringSets the background gradient fill type to either linear or radial.
Accepted Values: ['linear', 'none', 'radial']
Default Value: 'linear'
fixedBooleanSet to true to fix the position of the object.
Default Value: false
fontAngle
font-angle
NumberSets the text's angle. A positive value will rotate the object by that number of degrees clockwise, while a negative value.
fontColor
font-color
StringSets the font color of the text.
fontFamily
font-family
StringSets the text's font family.
fontSize
font-size
NumberSets the text's font size.
fontStyle
font-style
StringSets the text's font style.
Accepted Values: ['italic', 'none', 'normal', 'oblique']
fontWeight
font-weight
Number, StringSets the text's font weight. Similar to bold.
Accepted Values: ['bold', 'none', 'normal', `${string}`]
Default Value: 'normal'
gradientColors
gradient-colors
StringSets a set of colors for a complex background gradient consisting of 2 or more colors. To be used with gradient-stops.
Default Value: ''
gradientStops
gradient-stops
StringSets the gradient stops for a complex background gradient consisting of 2 or more colors. To be used with gradient-colors.
Default Value: ''
heightNumberSets the object's height.
htmlMode
html-mode
BooleanTo create HTML tooltips, set the value to `true`, and then in the attribute, provide your HTML markup.
Default Value: false
Chart types: Chord
idStringSets the id of the object.
Default Value: ''
italicBooleanSets whether the text is displayed with italicized characters or not.
Default Value: false
jsRule
js-rule
StringSet a window.functionName to call dynamically. Example: `jsRule: "window.functionName()"`.
lineGapSize
line-gap-size
NumberCan be used to create custom dashed or dotted lines when used with line-segment-size. This will control the size of the gaps between each line segment.
Default Value: 0
lineHeight
line-height
NumberSets the height of a line box.
Default Value: -1
lineSegmentSize
line-segment-size
NumberCan be used to create custom dashed or dotted lines when used with line-gap-size. This will control the size of the visible segment of line.
Default Value: 0
lineStyle
line-style
StringSets the line style of the object.
Accepted Values: ['dashdot', 'dashed', 'dotted', 'solid']
Default Value: ''
maxChars
max-chars
NumberSets the maximum numbers of characters displayed in the object. The value determines how many characters will be displayed before the text is cut and appended with "..."
Default Value: 0
maxHeight
max-height
NumberSets the maximum chart height in pixels.
Introduced in: v2.4.1
maxWidth
max-width
NumberSets a maximum width of the object.
maxWidth
max-width
NumberSets the maximum chart width in pixels.
Introduced in: v2.4.1
minHeight
min-height
NumberSets the minimum chart height in pixels.
Introduced in: v2.4.1
minWidth
min-width
NumberSets the minimum chart width in pixels.
Introduced in: v2.4.1
negationStringThis attribute will determine how negative values are handled. When using "format":"$%v" setting "negation":"currency" will move the - symbol to the outside of the $ sign. When using "negation" within the "plot": { } object you will see changes in things such as tooltips or anywhere else series data is used to populate values. You need to set "negation" in things such as "scale-y": { } separately.
Accepted Values: ['currency', 'standard']
Default Value: 'standard'
offsetX
offset-x
NumberSets an x-offset to apply when positioning the object.
Default Value: 0
offsetY
offset-y
NumberSets an y-offset to apply when positioning the object.
Default Value: 0
overlapBooleanSets whether the object allows overlapping with other labels. If false, and two objects overlap, only one will be displayed.
Default Value: true
paddingNumberSets the object's padding around the text. Up to four values can be entered to set the padding for all four sides, with the first value affecting the top padding, the second value affecting the right padding, and so on, in a clockwise direction.
Default Value: null
paddingBottom
padding-bottom
NumberSets the object's bottom padding around the text.
Default Value: 2
paddingLeft
padding-left
NumberSets the object's left padding around the text.
Default Value: 2
paddingRight
padding-right
NumberSets the object's right padding around the text.
Default Value: 2
paddingTop
padding-top
NumberSets the object's top padding around the text.
Default Value: 2
placementStringSets the placement of the object. For tooltips in pie charts: ['node:center', 'node:out']. For tooltips in area, bar, bubble, line, or scatter charts: ['node:bottom', 'node:top', 'node:center', 'node:left', 'node:right']. For tooltips, specifies where tooltips are placed relative to their node positions ['horizontal', 'vertical'].
Accepted Values: ['horizontal', 'node:bottom', 'node:center', 'node:left', 'node:out', 'node:right', 'node:top', 'vertical']
Default Value: ''
Chart types: Area,Bar,Bubble,Line,Pie,Scatter,Sunburst
positionStringSets the object's position relative to its container. Similar results can be obtained by setting [margin] and [margin-...] attributes. Uses x,y coordinates originating from the top left of the chart.
Default Value: ''
rectShortcut
rect-shortcut
BooleanUsed to force the library to create rectangles using a faster drawing API (instead of painting them like a closed polygon). However, using this would disable effects like rounded borders. It is a performance setting for edge cases.
Default Value: false
rtlBooleanRenders text right-to-left. Default value is false.
Default Value: false
shadowBooleanSets whether the object's shadow is visible or not. Has limited effect on HTML5 implementation.
Default Value: false
shortBooleanAutomatically shortens large units (e.g. 1000000 -> 1M).
Default Value: false
shortUnit
short-unit
StringSpecifies which unit of measure to use when `short` is set to true.
Accepted Values: ['B', 'K', 'M', 'b', 'k', 'm']
Default Value: ''
Introduced in: v2.3.1
stickyBooleanCreates sticky object. Use this with `timeout` to specify how long for object to stick to chart.
Default Value: false
textStringSets the text content of the object.
Default Value: null
textAlign
text-align
StringSets the alignment of the object. For textboxes, sets the text's horizontal alignment relative to the object's box ['center', 'bottom', 'left', 'middle', 'right'].
Accepted Values: ['bottom', 'center', 'left', 'middle', 'right']
Default Value: 'center'
textAlpha
text-alpha
NumberSets the opacity on the text, with 0 being fully transparent and 1 being fully opaque. Note that decimal value requires the leading 0.
Default Value: true
textChord
text-chord
StringSets the text of the tooltip in chord chart when user hover over a chord.
Chart types: Chord
textDecoration
text-decoration
StringSets the text's decoration to use underlined characters. Similar to underline. May not display properly in Mozilla Firefox when charts are rendered using SVG.
Default Value: 'none'
thousandsSeparator
thousands-separator
StringSets the character used to separate thousands.
Default Value: null
timeoutNumberTime in milliseconds for object to remain sticky. Use this with `sticky` to specify whether object should stick to chart.
Default Value: 250
underlineBooleanSets whether the text is displayed with underlined characters or not.
Default Value: false
verticalAlign
vertical-align
StringSets vertical alignment of the object. For textboxes, aligns relative to object's box. Accepted values: ['top', 'middle', 'bottom'].
Accepted Values: ['bottom', 'middle', 'top']
Default Value: 'middle'
visibleBooleanSets the visibility of the object. Allows you to turn off the object without removing lines of JSON.
Default Value: true
widthNumberSets the object's width.
xNumberSets the X position of the object.
Default Value: -1
yNumberSets the Y position of the object.
zIndex
z-index
NumberSets the z position of the object. Objects with higher z indexes will appear "above" those with lower z index values.
Default Value: 1