JohnCoene / echarts4r

🐳 ECharts 5 for R
http://echarts4r.john-coene.com/
Other
585 stars 82 forks source link

Cannot pass `align` property to rich in `e_title()` #590

Closed gacolitti closed 6 months ago

gacolitti commented 7 months ago

I would like to control the alignment of the title text and subtext separately and thought this was possible by passing align to rich.

For example:

mtcars |>
  e_charts_("qsec") |>
  e_line(mpg) |> 
  echarts4r::e_legend(show = F) |> 
  e_title(text = "This is not centered", 
          subtext = "This is not left aligned",
          textStyle = list(rich = list(align = "center")),
          subtextStyle = list(rich = list(align = "left")),
          left = "50%")

But the use of the align property here doesn't seem to have any effect.

image

rdatasculptor commented 7 months ago

Hi @gacolitti You are mentioning subtext, but it isn't in your code. Maybe you can add it? It helps finding a solution.

gacolitti commented 7 months ago

The reprex I gave you didn't illustrate the issue. Just updated the code and screenshot.

rdatasculptor commented 7 months ago

So the subtext should be placed at the left side above the chart?

munoztd0 commented 6 months ago

Moving the title alone without moving the subtext is not supported by echarts see https://github.com/apache/echarts/issues/9968