score:9
Accepted answer
ok. after so many trial and errors, i managed to do this. here is how i did (providing here to help future readers).
i added a column called value in my dataset
data1 <- data1 %>% mutate(value = ifelse(changelabel == ">20% decrease",1,
ifelse(changelabel == "<20% decrease",2,
ifelse(changelabel == "<20% increase",3,
ifelse(changelabel == ">20% increase",4, 5)))))
and then i created a data class for color axis:
dclass <- data_frame(from = seq(1, 4, by = 1),
name = c(">20% decrease","<20% decrease","<20% increase",">20% increase"),
color = c("#00b0f0","#b7dee8","#92d050","#00b050"))
dclass <- list_parse(dclass)
then in my chart making code i added this line:
hc_coloraxis(dataclasses = dclass)
now it works with proper legend as i expected.
Source: stackoverflow.com
Related Query
- Highmap R (or) javascript - adding custom legend
- Adding thousands separator for custom formatted highcharts tooltip
- Optimize JavaScript DrillDown code
- Highcarts custom legend
- Symbol-outline with pie chart -or- custom legend symbols
- Highcharts Legend Custom HTML
- Adding a custom tooltip to a bubble chart / highchart
- JavaScript code inside TypeScript file .ts not working
- Custom Highcharts legend symbol
- Angular Highcharts Custom Legend Label In Area Chart
- Custom legend in rCharts (highcharts)
- Highcharts styling, Legend & custom fonts
- Adding flags to Highstock chart (highcharts) with JavaScript
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- Creating series/group titles in legend in Highcharts JavaScript pie chart
- Set custom legend item symbol (or icon) in HIghcharts
- Adding different style to a series in legend in Highcharts
- Highcharts legend custom css style / format using only highcharts options
- highcharts - how do I do custom labels on heatmap legend
- passing formatting JavaScript code to HighCharts with JSON
- Embed javascript code in a django template
- Highcharts: Adding extra text to legend
- Customizing X axis Highcharts, adding custom markers under the X axis
- Highcharts custom symbol legend
- Pie Chart Custom Legend
- Adding tooltip to legend in highcharts
- Highcharts Custom SVG Marker Symbol is Shaped Different in Legend
- Highcharts type flags with custom legend icon
- Display custom tooltip on highcharts legend
- HighCharts: Custom button next to legend inside chart area
More Query from same tag
- The color of axis is the same as line of series
- Highstock xAxis datetime
- Highcharts: Draw line from data markers to axis?
- JSON api timestamp + data parsing
- Loading Highcharts within an angular application
- highcharts tooltip stop update when mouse over
- Align date ticks on x axis
- Highcharts: Column chart with empty data
- How to decouple range selector with input Box in highcharts?
- Highcharts x axis formatting options
- Highcharter format number in tooltip
- GridLines getting removed on y-axis visibility off
- How to display non-graphed data from CSV file in Highcharts' tooltip?
- Set background color to DotNet.Highcharts
- how to draw column with value=0 in highcharts
- How to fix Prototype conflict with Highchart?
- I need to show multiple axis, which is having constant values in the x-axis and dynamic values in y-axises
- High chart animation lag after it moves from viewport
- Highcharts bar chart with bar colored based on value
- How to create india map chart using Hightcharts?
- Is there a way to to always show the data along with tooltip data rather on on hover only in highcharts-stockchart?
- a better way to color many individual markers in a scatter chart?
- Highcharts - colorByPoint does not work
- the picture from highcharts in the PDF made by html2canvas is blurry?
- Highcharts JS: How do I decrease the spacing between Y values?
- Truncating Y-Axis Title in Highcharts v4.1.5
- Highcharts - How do I position tooltip behind icon on each pie slice on hover?
- Highcharts prevent xAxis Labels hidden
- how to draw dotted line vertical line at 0 postiion in highChart
- Highchart connector custom style