Skip to contents

helper function for generating axis break zigzags in chart

Usage

e_zigzag(e, axis = "y", start, end, gap = "3%", zigzagAmplitude = 10, ...)

Arguments

e

An echarts4r object as returned by e_charts or a proxy as returned by echarts4rProxy.

axis

Axis to apply formatter to. Supports x and y axis

start, end

Start and End point for boundary of zigzag. Also supports vectors for generating multiple breaks. Can also support time values.

gap

Determines the visual size of the axis break area. Supports Percentage(String) as proportional value relative to axis. Supports Absolute value(numeric) which refers to literal values in the axis similar to start,end (Not a pixel value).

zigzagAmplitude

Amplitude of zigzag. Unit is pixels.

...

Any other arguments to pass to breakArea argument.

Examples


df <- data.frame(
              x = c("a", "b", "c", "d", "c"),
              y = c(100, 200, 200, 700, 300)
             )

df |>
  e_charts(x) |>
  e_bar(y) |>
  e_zigzag(axis = 'y', start = 400, end = 500)
df |> e_charts(x) |> e_bar(y) |> e_zigzag(axis = 'y', start = c(125,400), end = c(150,500))