highcharter icon indicating copy to clipboard operation
highcharter copied to clipboard

check for chart type

Open shosaco opened this issue 4 years ago • 1 comments

When a user forgets to add a type to hchart, a non-informative error is thrown:

library(highcharter)
hchart(mtcars, hcaes(x = mpg, y = cyl))
#> Error: Assigned data `type` must be compatible with existing data.
#> x Existing data has 1 row.
#> x Assigned data has 2 rows.
#> i Row updates require a list value. Do you need `list()` or `as.list()`?
#> Warning in if (type == "heatmap") {: Condition has length > 1 and only the first element will be used.
#> 2: In if (type %in% c("bubble", "scatter")) { : Condition has length > 1 and only the first element will be used.

This PR enables the following behaviour:

library(highcharter)
hchart(mtcars, hcaes(x = mpg, y = cyl))
#> Error: Chart type must be provided.

shosaco avatar Nov 09 '20 15:11 shosaco

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Feel free to reopen it if you find it necessary.

stale[bot] avatar Sep 09 '22 01:09 stale[bot]