jbkunst / highcharter

R wrapper for highcharts
http://jkunst.com/highcharter/
Other
720 stars 148 forks source link

colorAxis issues #692

Closed royfrancis closed 2 years ago

royfrancis commented 3 years ago
  1. Default doesn't create the color axis at all.
highcharter::hchart(iris,"scatter",hcaes(Petal.Width,Petal.Length,color=Petal.Width)) %>%
  hc_colorAxis()

Rplot01

  1. Specifying min/max creates wrong scale on the color axis.
highcharter::hchart(iris,"scatter",hcaes(Petal.Width,Petal.Length,color=Petal.Width)) %>%
  hc_colorAxis(min=min(iris$Petal.Width),max=max(iris$Petal.Width))

Rplot

  1. With manual colorize, the colour scale marker on the color axis does not match that in data.
library(highcharter)
cols <- c("red","green","blue")
hchart(iris,"scatter",hcaes(Petal.Width,Petal.Length,color=colorize(Petal.Width,cols))) %>%
  hc_colorAxis(min=min(iris$Petal.Width),max=max(iris$Petal.Width),stops=color_stops(10,cols))

Rplot01

This is probably to do with the fact that the 'color' argument uses rescaled values while the colorAxis still uses the original values. So hchart needs to be able to differentiate values used for color vs the actual values (used in tooltip and colorAxis).

R 4.0.0 highcharter_0.8.2

stale[bot] commented 2 years ago

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.