We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, This my dataset
df <- data.frame(dose=c("D0.5", "D1", "D2"), len=c(4.2, 10, 29.5))
I want to change the color of just one label (the label "D1") in red (not all the labels). I saw this documentation : https://api.highcharts.com/highcharts/xAxis.labels.formatter and I tried to do the same thing but nothing has changed
How do I apply style to individual labels to get only the label "D1" in red ? This is what I did :
df <- data.frame(dose=c("D0.5", "D1", "D2"), len=c(4.2, 10, 29.5)) highchart() %>% hc_add_series( data = df$len, type = 'line' ) %>% hc_xAxis(categories = df$dose, labels = list( formatter = JS( " function() { if (this.value =='D1' ) { return '<span style='fill: red;'>' + this.value + '</span>'; } return this.value; } " ) ))
Some help would be appreciated
The text was updated successfully, but these errors were encountered:
You're close but you need to use double quotes and escape them for the style attribute. Also I think 'color' is more appropriate when stylizing text.
highchart() %>% hc_add_series( data = df$len, type = 'line' ) %>% hc_xAxis(categories = df$dose, labels = list( # useHTML = T, formatter = JS( "function() { if (this.value =='D1' ) { console.log(this.value) return '<span style=\"color: red;\">' + this.value + '</span>'; } return this.value; }" ) ))
Sorry, something went wrong.
No branches or pull requests
Hi,
This my dataset
I want to change the color of just one label (the label "D1") in red (not all the labels).
I saw this documentation :
https://api.highcharts.com/highcharts/xAxis.labels.formatter
and I tried to do the same thing but nothing has changed
How do I apply style to individual labels to get only the label "D1" in red ?
This is what I did :
Some help would be appreciated
The text was updated successfully, but these errors were encountered: