Closed
Description
I want to change the width and height of the heatmap elements to make them square. Here is my code:
library(echarts4r)
library(dplyr)
table <- "kn ln gr cn
1 BA BA 10
1 XB XB 1
2 FL XB 5
2 GS BC 6
3 GG BC 4
3 BS BA 0"
df <- read.table(text = table, header = TRUE, sep = "\t")
df_grouped <- df |>
arrange(gr, ln) |>
mutate(ln = factor(ln, levels = unique(ln)))
df_grouped |>
e_charts(kn) |>
e_heatmap(ln, cn, name = "value") |>
e_x_axis(data = unique(df$kn)) |>
e_y_axis(data = unique(df_grouped$ln),
axisLabel = list(rotate = 0, interval = 0, fontSize = 10, color = 'black'),
scale = TRUE,
axisTick = list(alignWithLabel = TRUE)
) |>
e_visual_map(cn) |>
e_toolbox(
feature = list(
dataZoom = list(
xAxisIndex = 0,
yAxisIndex = 0
),
restore = list()
)
)
Metadata
Metadata
Assignees
Labels
No labels