JohnCoene / echarts4r

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

Fix `e_legend` such that `icon` argument can be used. #499

Closed yogat3ch closed 1 year ago

yogat3ch commented 1 year ago

R's partial matching of arguments made it such that a single value passed as argument icon to e_legend when multiple legend$data objects are present in the chart causes this error:

Error in echarts4r::e_legend(e, icon = "circle") : 
  invalid number of icons; 1 icons passed but 4 legend items.

This modifies e_legend to allow for the expected behavior which uses it as the icon argument in opts$legend effectively changing the icon for the entire legend.