bar
Method of Figure.
Overloads
| Name | Description |
|---|---|
bar(const Object x, const Object y) -> Figure | Adds a bar series from x/y pairs. |
bar(const Object points) -> Figure | Adds a bar series from point data. |
bar(const Object points, const Map options) -> Figure | Adds a bar series from point data. |
bar(const Object x, const Object y, const Map options) -> Figure | Adds a bar series from x/y pairs. |
bar(const Map options) -> Figure | Adds a bar series defined by options only. |
bar(const Object x, const Object y) -> Figure
Adds a bar series from x/y pairs.
Parameters
bar(const Object points) -> Figure
Adds a bar series from point data.
Parameters
- points: List or array of points, typically [x,y] or [x,y,value].
bar(const Object points, const Map options) -> Figure
Adds a bar series from point data.
Parameters
- points: List or array of points, typically [x,y] or [x,y,value].
- options: Series option map merged into the series.
- id (string): Component ID.
- name (string): Series name for legend and tooltip.
- color_by (string): Color mapping: 'series' or 'data'.
- legend_hover_link (boolean): Highlight series on legend hover.
- coordinate_system (string): Coordinate system: cartesian2d/polar.
- coordinate_system_usage (string): Layout usage: 'data'.
- coord (List|number|string): Coord input for coordinate system (when usage is 'box').
- x_axis_index (number): xAxis index.
- x_axis_id (number): xAxis id.
- y_axis_index (number): yAxis index.
- y_axis_id (number): yAxis id.
- polar_index (number): Polar index.
- polar_id (number): Polar id.
- round_cap (boolean): Use round caps for polar bars.
- realtime_sort (boolean): Enable realtime sorting for bar racing.
- show_background (boolean): Show background behind bars.
- background_style (Map): Background style for bars.
- background_style.color (Color): Background color.
- background_style.border_color (Color): Background border color.
- background_style.border_width (number): Background border width.
- background_style.border_type (string): Background border type.
- background_style.border_radius (number|List): Background border radius.
- background_style.shadow_blur (number): Background shadow blur.
- background_style.shadow_color (Color): Background shadow color.
- background_style.shadow_offset_x (number): Background shadow offset X.
- background_style.shadow_offset_y (number): Background shadow offset Y.
- background_style.opacity (number): Background opacity.
- label (Map): Label options.
- label.show (boolean): Show label.
- label.distance (number): Label distance.
- label.rotate (number): Label rotation.
- label.offset (List): Label offset.
- label.text_margin (number|List): Label margin around text.
- label.min_margin (number): Minimum margin between labels.
- label.formatter (string): Label formatter.
- label.color (Color): Label color.
- label.font_style (string): Label font style.
- label.font_weight (string|number): Label font weight.
- label.font_family (string): Label font family.
- label.font_size (number): Label font size.
- label.align (string): Label horizontal alignment.
- label.vertical_align (string): Label vertical alignment.
- label.line_height (number): Label line height.
- label.background_color (string|Map): Label background.
- label.border_color (Color): Label border color.
- label.border_width (number): Label border width.
- label.border_type (string|number|List): Label border type.
- label.border_dash_offset (number): Label border dash offset.
- label.border_radius (number): Label border radius.
- label.padding (number|List): Label padding.
- label.shadow_color (Color): Label shadow color.
- label.shadow_blur (number): Label shadow blur.
- label.shadow_offset_x (number): Label shadow offset X.
- label.shadow_offset_y (number): Label shadow offset Y.
- label.width (number): Label width.
- label.height (number): Label height.
- label.text_border_color (Color): Label text stroke color.
- label.text_border_width (number): Label text stroke width.
- label.text_border_type (string|number|List): Label text stroke type.
- label.text_border_dash_offset (number): Label text stroke dash offset.
- label.text_shadow_color (Color): Label text shadow color.
- label.text_shadow_blur (number): Label text shadow blur.
- label.text_shadow_offset_x (number): Label text shadow offset X.
- label.text_shadow_offset_y (number): Label text shadow offset Y.
- label.overflow (string): Label overflow handling.
- label.ellipsis (string): Label ellipsis.
- label.rich (Map): Label rich text styles.
- label.rich_inherit_plain_label (boolean): Rich text inherits plain styles.
- label.position (string|List): Label position.
- label_line (Map): Label line options.
- label_line.show (boolean): Show label line.
- label_line.line_style (Map): Label line style.
- item_style (Map): Item style options.
- item_style.color (Color): Bar color.
- item_style.border_color (Color): Bar border color.
- item_style.border_width (number): Bar border width.
- item_style.border_type (string): Bar border type.
- item_style.border_radius (number|List): Bar border radius.
- item_style.shadow_blur (number): Bar shadow blur.
- item_style.shadow_color (Color): Bar shadow color.
- item_style.shadow_offset_x (number): Bar shadow offset X.
- item_style.shadow_offset_y (number): Bar shadow offset Y.
- item_style.opacity (number): Bar opacity.
- item_style.decal (Map): Decal style options.
- label_layout (Map): Label layout options.
- label_layout.hide_overlap (boolean): Hide overlapped labels.
- label_layout.move_overlap (string): Move overlapped labels.
- label_layout.x (number|string): Label x position.
- label_layout.y (number|string): Label y position.
- label_layout.dx (number): Label x offset.
- label_layout.dy (number): Label y offset.
- label_layout.rotate (number): Label rotation.
- label_layout.width (number): Label width.
- label_layout.height (number): Label height.
- label_layout.align (string): Label horizontal alignment.
- label_layout.vertical_align (string): Label vertical alignment.
- label_layout.font_size (number): Label font size.
- label_layout.draggable (boolean): Allow dragging labels.
- label_layout.label_line_points (List): Label line points.
- emphasis (Map): Emphasis state options.
- emphasis.label (Map): Emphasis label options.
- emphasis.label_line (Map): Emphasis label line options.
- emphasis.item_style (Map): Emphasis item style options.
- blur (Map): Blur state options.
- blur.label (Map): Blur label options.
- blur.label_line (Map): Blur label line options.
- blur.item_style (Map): Blur item style options.
- select (Map): Select state options.
- select.label (Map): Select label options.
- select.label_line (Map): Select label line options.
- select.item_style (Map): Select item style options.
- emphasis.disabled (boolean): Disable emphasis state.
- emphasis.focus (string): Focus mode: none/self/series.
- emphasis.blur_scope (string): Blur scope: coordinateSystem/series/global.
- select.disabled (boolean): Disable selection.
- selected_mode (boolean|string): Selection mode: true/false/'single'/'multiple'/'series'.
- stack (string): Stack group name.
- stack_strategy (string): Stacking strategy: samesign/all/positive/negative.
- stack_order (string): Stack order: seriesAsc/seriesDesc.
- sampling (string): Downsampling strategy.
- cursor (string): Mouse cursor when hovering.
- bar_width (number|string): Bar width.
- bar_max_width (number|string): Max bar width.
- bar_min_width (number|string): Min bar width.
- bar_min_height (number): Min bar height.
- bar_min_angle (number): Min bar angle for polar.
- bar_gap (string): Gap between bars.
- bar_category_gap (number|string): Gap within a category.
- large (boolean): Enable large data optimization.
- large_threshold (number): Large data threshold.
- progressive (number): Progressive rendering amount.
- progressive_threshold (number): Progressive rendering threshold.
- progressive_chunk_mode (string): Progressive chunking mode.
- dimensions (List): Dimensions definition.
- encode (Map): Encode mapping.
- series_layout_by (string): Dataset layout: 'column' or 'row'.
- dataset_index (number): Dataset index to use.
- data_group_id (string): Group ID for data items.
- data (List): Series data.
- clip (boolean): Clip overflow on coordinate system.
- mark_point (Map): Mark point options.
- mark_line (Map): Mark line options.
- mark_area (Map): Mark area options.
- zlevel (number): Canvas layer.
- z (number): Z order.
- silent (boolean): Ignore mouse events.
- animation (boolean): Enable animation.
- animation_threshold (number): Animation threshold.
- animation_duration (number): Initial animation duration.
- animation_easing (string): Initial animation easing.
- animation_delay (number): Initial animation delay.
- animation_duration_update (number): Update animation duration.
- animation_easing_update (string): Update animation easing.
- animation_delay_update (number): Update animation delay.
- universal_transition (Map|boolean): Universal transition options.
- universal_transition.enabled (boolean): Enable universal transition.
- universal_transition.series_key (string|List): Series key(s) for transition.
- universal_transition.divide_shape (string): Split strategy: split/clone.
- tooltip (Map): Series tooltip options.
bar(const Object x, const Object y, const Map options) -> Figure
Adds a bar series from x/y pairs.
Parameters
- x: List, array, or range of x values.
- y: List, array, or range of y values.
- options: Series option map merged into the series.
- id (string): Component ID.
- name (string): Series name for legend and tooltip.
- color_by (string): Color mapping: 'series' or 'data'.
- legend_hover_link (boolean): Highlight series on legend hover.
- coordinate_system (string): Coordinate system: cartesian2d/polar.
- coordinate_system_usage (string): Layout usage: 'data'.
- coord (List|number|string): Coord input for coordinate system (when usage is 'box').
- x_axis_index (number): xAxis index.
- x_axis_id (number): xAxis id.
- y_axis_index (number): yAxis index.
- y_axis_id (number): yAxis id.
- polar_index (number): Polar index.
- polar_id (number): Polar id.
- round_cap (boolean): Use round caps for polar bars.
- realtime_sort (boolean): Enable realtime sorting for bar racing.
- show_background (boolean): Show background behind bars.
- background_style (Map): Background style for bars.
- background_style.color (Color): Background color.
- background_style.border_color (Color): Background border color.
- background_style.border_width (number): Background border width.
- background_style.border_type (string): Background border type.
- background_style.border_radius (number|List): Background border radius.
- background_style.shadow_blur (number): Background shadow blur.
- background_style.shadow_color (Color): Background shadow color.
- background_style.shadow_offset_x (number): Background shadow offset X.
- background_style.shadow_offset_y (number): Background shadow offset Y.
- background_style.opacity (number): Background opacity.
- label (Map): Label options.
- label.show (boolean): Show label.
- label.distance (number): Label distance.
- label.rotate (number): Label rotation.
- label.offset (List): Label offset.
- label.text_margin (number|List): Label margin around text.
- label.min_margin (number): Minimum margin between labels.
- label.formatter (string): Label formatter.
- label.color (Color): Label color.
- label.font_style (string): Label font style.
- label.font_weight (string|number): Label font weight.
- label.font_family (string): Label font family.
- label.font_size (number): Label font size.
- label.align (string): Label horizontal alignment.
- label.vertical_align (string): Label vertical alignment.
- label.line_height (number): Label line height.
- label.background_color (string|Map): Label background.
- label.border_color (Color): Label border color.
- label.border_width (number): Label border width.
- label.border_type (string|number|List): Label border type.
- label.border_dash_offset (number): Label border dash offset.
- label.border_radius (number): Label border radius.
- label.padding (number|List): Label padding.
- label.shadow_color (Color): Label shadow color.
- label.shadow_blur (number): Label shadow blur.
- label.shadow_offset_x (number): Label shadow offset X.
- label.shadow_offset_y (number): Label shadow offset Y.
- label.width (number): Label width.
- label.height (number): Label height.
- label.text_border_color (Color): Label text stroke color.
- label.text_border_width (number): Label text stroke width.
- label.text_border_type (string|number|List): Label text stroke type.
- label.text_border_dash_offset (number): Label text stroke dash offset.
- label.text_shadow_color (Color): Label text shadow color.
- label.text_shadow_blur (number): Label text shadow blur.
- label.text_shadow_offset_x (number): Label text shadow offset X.
- label.text_shadow_offset_y (number): Label text shadow offset Y.
- label.overflow (string): Label overflow handling.
- label.ellipsis (string): Label ellipsis.
- label.rich (Map): Label rich text styles.
- label.rich_inherit_plain_label (boolean): Rich text inherits plain styles.
- label.position (string|List): Label position.
- label_line (Map): Label line options.
- label_line.show (boolean): Show label line.
- label_line.line_style (Map): Label line style.
- item_style (Map): Item style options.
- item_style.color (Color): Bar color.
- item_style.border_color (Color): Bar border color.
- item_style.border_width (number): Bar border width.
- item_style.border_type (string): Bar border type.
- item_style.border_radius (number|List): Bar border radius.
- item_style.shadow_blur (number): Bar shadow blur.
- item_style.shadow_color (Color): Bar shadow color.
- item_style.shadow_offset_x (number): Bar shadow offset X.
- item_style.shadow_offset_y (number): Bar shadow offset Y.
- item_style.opacity (number): Bar opacity.
- item_style.decal (Map): Decal style options.
- label_layout (Map): Label layout options.
- label_layout.hide_overlap (boolean): Hide overlapped labels.
- label_layout.move_overlap (string): Move overlapped labels.
- label_layout.x (number|string): Label x position.
- label_layout.y (number|string): Label y position.
- label_layout.dx (number): Label x offset.
- label_layout.dy (number): Label y offset.
- label_layout.rotate (number): Label rotation.
- label_layout.width (number): Label width.
- label_layout.height (number): Label height.
- label_layout.align (string): Label horizontal alignment.
- label_layout.vertical_align (string): Label vertical alignment.
- label_layout.font_size (number): Label font size.
- label_layout.draggable (boolean): Allow dragging labels.
- label_layout.label_line_points (List): Label line points.
- emphasis (Map): Emphasis state options.
- emphasis.label (Map): Emphasis label options.
- emphasis.label_line (Map): Emphasis label line options.
- emphasis.item_style (Map): Emphasis item style options.
- blur (Map): Blur state options.
- blur.label (Map): Blur label options.
- blur.label_line (Map): Blur label line options.
- blur.item_style (Map): Blur item style options.
- select (Map): Select state options.
- select.label (Map): Select label options.
- select.label_line (Map): Select label line options.
- select.item_style (Map): Select item style options.
- emphasis.disabled (boolean): Disable emphasis state.
- emphasis.focus (string): Focus mode: none/self/series.
- emphasis.blur_scope (string): Blur scope: coordinateSystem/series/global.
- select.disabled (boolean): Disable selection.
- selected_mode (boolean|string): Selection mode: true/false/'single'/'multiple'/'series'.
- stack (string): Stack group name.
- stack_strategy (string): Stacking strategy: samesign/all/positive/negative.
- stack_order (string): Stack order: seriesAsc/seriesDesc.
- sampling (string): Downsampling strategy.
- cursor (string): Mouse cursor when hovering.
- bar_width (number|string): Bar width.
- bar_max_width (number|string): Max bar width.
- bar_min_width (number|string): Min bar width.
- bar_min_height (number): Min bar height.
- bar_min_angle (number): Min bar angle for polar.
- bar_gap (string): Gap between bars.
- bar_category_gap (number|string): Gap within a category.
- large (boolean): Enable large data optimization.
- large_threshold (number): Large data threshold.
- progressive (number): Progressive rendering amount.
- progressive_threshold (number): Progressive rendering threshold.
- progressive_chunk_mode (string): Progressive chunking mode.
- dimensions (List): Dimensions definition.
- encode (Map): Encode mapping.
- series_layout_by (string): Dataset layout: 'column' or 'row'.
- dataset_index (number): Dataset index to use.
- data_group_id (string): Group ID for data items.
- data (List): Series data.
- clip (boolean): Clip overflow on coordinate system.
- mark_point (Map): Mark point options.
- mark_line (Map): Mark line options.
- mark_area (Map): Mark area options.
- zlevel (number): Canvas layer.
- z (number): Z order.
- silent (boolean): Ignore mouse events.
- animation (boolean): Enable animation.
- animation_threshold (number): Animation threshold.
- animation_duration (number): Initial animation duration.
- animation_easing (string): Initial animation easing.
- animation_delay (number): Initial animation delay.
- animation_duration_update (number): Update animation duration.
- animation_easing_update (string): Update animation easing.
- animation_delay_update (number): Update animation delay.
- universal_transition (Map|boolean): Universal transition options.
- universal_transition.enabled (boolean): Enable universal transition.
- universal_transition.series_key (string|List): Series key(s) for transition.
- universal_transition.divide_shape (string): Split strategy: split/clone.
- tooltip (Map): Series tooltip options.
bar(const Map options) -> Figure
Adds a bar series defined by options only.
Parameters
- options: Series option map, commonly used with dataset/encode.
- id (string): Component ID.
- name (string): Series name for legend and tooltip.
- color_by (string): Color mapping: 'series' or 'data'.
- legend_hover_link (boolean): Highlight series on legend hover.
- coordinate_system (string): Coordinate system: cartesian2d/polar.
- coordinate_system_usage (string): Layout usage: 'data'.
- coord (List|number|string): Coord input for coordinate system (when usage is 'box').
- x_axis_index (number): xAxis index.
- x_axis_id (number): xAxis id.
- y_axis_index (number): yAxis index.
- y_axis_id (number): yAxis id.
- polar_index (number): Polar index.
- polar_id (number): Polar id.
- round_cap (boolean): Use round caps for polar bars.
- realtime_sort (boolean): Enable realtime sorting for bar racing.
- show_background (boolean): Show background behind bars.
- background_style (Map): Background style for bars.
- background_style.color (Color): Background color.
- background_style.border_color (Color): Background border color.
- background_style.border_width (number): Background border width.
- background_style.border_type (string): Background border type.
- background_style.border_radius (number|List): Background border radius.
- background_style.shadow_blur (number): Background shadow blur.
- background_style.shadow_color (Color): Background shadow color.
- background_style.shadow_offset_x (number): Background shadow offset X.
- background_style.shadow_offset_y (number): Background shadow offset Y.
- background_style.opacity (number): Background opacity.
- label (Map): Label options.
- label.show (boolean): Show label.
- label.distance (number): Label distance.
- label.rotate (number): Label rotation.
- label.offset (List): Label offset.
- label.text_margin (number|List): Label margin around text.
- label.min_margin (number): Minimum margin between labels.
- label.formatter (string): Label formatter.
- label.color (Color): Label color.
- label.font_style (string): Label font style.
- label.font_weight (string|number): Label font weight.
- label.font_family (string): Label font family.
- label.font_size (number): Label font size.
- label.align (string): Label horizontal alignment.
- label.vertical_align (string): Label vertical alignment.
- label.line_height (number): Label line height.
- label.background_color (string|Map): Label background.
- label.border_color (Color): Label border color.
- label.border_width (number): Label border width.
- label.border_type (string|number|List): Label border type.
- label.border_dash_offset (number): Label border dash offset.
- label.border_radius (number): Label border radius.
- label.padding (number|List): Label padding.
- label.shadow_color (Color): Label shadow color.
- label.shadow_blur (number): Label shadow blur.
- label.shadow_offset_x (number): Label shadow offset X.
- label.shadow_offset_y (number): Label shadow offset Y.
- label.width (number): Label width.
- label.height (number): Label height.
- label.text_border_color (Color): Label text stroke color.
- label.text_border_width (number): Label text stroke width.
- label.text_border_type (string|number|List): Label text stroke type.
- label.text_border_dash_offset (number): Label text stroke dash offset.
- label.text_shadow_color (Color): Label text shadow color.
- label.text_shadow_blur (number): Label text shadow blur.
- label.text_shadow_offset_x (number): Label text shadow offset X.
- label.text_shadow_offset_y (number): Label text shadow offset Y.
- label.overflow (string): Label overflow handling.
- label.ellipsis (string): Label ellipsis.
- label.rich (Map): Label rich text styles.
- label.rich_inherit_plain_label (boolean): Rich text inherits plain styles.
- label.position (string|List): Label position.
- label_line (Map): Label line options.
- label_line.show (boolean): Show label line.
- label_line.line_style (Map): Label line style.
- item_style (Map): Item style options.
- item_style.color (Color): Bar color.
- item_style.border_color (Color): Bar border color.
- item_style.border_width (number): Bar border width.
- item_style.border_type (string): Bar border type.
- item_style.border_radius (number|List): Bar border radius.
- item_style.shadow_blur (number): Bar shadow blur.
- item_style.shadow_color (Color): Bar shadow color.
- item_style.shadow_offset_x (number): Bar shadow offset X.
- item_style.shadow_offset_y (number): Bar shadow offset Y.
- item_style.opacity (number): Bar opacity.
- item_style.decal (Map): Decal style options.
- label_layout (Map): Label layout options.
- label_layout.hide_overlap (boolean): Hide overlapped labels.
- label_layout.move_overlap (string): Move overlapped labels.
- label_layout.x (number|string): Label x position.
- label_layout.y (number|string): Label y position.
- label_layout.dx (number): Label x offset.
- label_layout.dy (number): Label y offset.
- label_layout.rotate (number): Label rotation.
- label_layout.width (number): Label width.
- label_layout.height (number): Label height.
- label_layout.align (string): Label horizontal alignment.
- label_layout.vertical_align (string): Label vertical alignment.
- label_layout.font_size (number): Label font size.
- label_layout.draggable (boolean): Allow dragging labels.
- label_layout.label_line_points (List): Label line points.
- emphasis (Map): Emphasis state options.
- emphasis.label (Map): Emphasis label options.
- emphasis.label_line (Map): Emphasis label line options.
- emphasis.item_style (Map): Emphasis item style options.
- blur (Map): Blur state options.
- blur.label (Map): Blur label options.
- blur.label_line (Map): Blur label line options.
- blur.item_style (Map): Blur item style options.
- select (Map): Select state options.
- select.label (Map): Select label options.
- select.label_line (Map): Select label line options.
- select.item_style (Map): Select item style options.
- emphasis.disabled (boolean): Disable emphasis state.
- emphasis.focus (string): Focus mode: none/self/series.
- emphasis.blur_scope (string): Blur scope: coordinateSystem/series/global.
- select.disabled (boolean): Disable selection.
- selected_mode (boolean|string): Selection mode: true/false/'single'/'multiple'/'series'.
- stack (string): Stack group name.
- stack_strategy (string): Stacking strategy: samesign/all/positive/negative.
- stack_order (string): Stack order: seriesAsc/seriesDesc.
- sampling (string): Downsampling strategy.
- cursor (string): Mouse cursor when hovering.
- bar_width (number|string): Bar width.
- bar_max_width (number|string): Max bar width.
- bar_min_width (number|string): Min bar width.
- bar_min_height (number): Min bar height.
- bar_min_angle (number): Min bar angle for polar.
- bar_gap (string): Gap between bars.
- bar_category_gap (number|string): Gap within a category.
- large (boolean): Enable large data optimization.
- large_threshold (number): Large data threshold.
- progressive (number): Progressive rendering amount.
- progressive_threshold (number): Progressive rendering threshold.
- progressive_chunk_mode (string): Progressive chunking mode.
- dimensions (List): Dimensions definition.
- encode (Map): Encode mapping.
- series_layout_by (string): Dataset layout: 'column' or 'row'.
- dataset_index (number): Dataset index to use.
- data_group_id (string): Group ID for data items.
- data (List): Series data.
- clip (boolean): Clip overflow on coordinate system.
- mark_point (Map): Mark point options.
- mark_line (Map): Mark line options.
- mark_area (Map): Mark area options.
- zlevel (number): Canvas layer.
- z (number): Z order.
- silent (boolean): Ignore mouse events.
- animation (boolean): Enable animation.
- animation_threshold (number): Animation threshold.
- animation_duration (number): Initial animation duration.
- animation_easing (string): Initial animation easing.
- animation_delay (number): Initial animation delay.
- animation_duration_update (number): Update animation duration.
- animation_easing_update (string): Update animation easing.
- animation_delay_update (number): Update animation delay.
- universal_transition (Map|boolean): Universal transition options.
- universal_transition.enabled (boolean): Enable universal transition.
- universal_transition.series_key (string|List): Series key(s) for transition.
- universal_transition.divide_shape (string): Split strategy: split/clone.
- tooltip (Map): Series tooltip options.