score:1
Accepted answer
Making use of the color_stops
helper you could set the stops for the fill color gradient like so:
Note: To get a gradient you have to set y2=1
in linearGradient
.
library(quantmod)
library(highcharter)
df = getSymbols("SPY", auto.assign = F)
highchart() %>%
hc_chart(
type = "container", zoomType = "x") %>%
hc_plotOptions(
area = list(
fillColor = list(
linearGradient = list(
x1 = 0,
y1 = 0,
x2 = 0,
y2 = 1
),
stops = color_stops(n = 2, colors = c("#2f7ed8","white"))
),
marker = list(
radius = 2
),
lineWidth = 1,
states = list(
hover = list(
lineWidth = 1
)
),
threshold = NULL
)
) %>%
hc_add_series(type = "area", name = "test", data = df$SPY.Close) %>%
hc_legend(enabled = FALSE) %>%
hc_xAxis(type = "datetime")
Source: stackoverflow.com
Related Query
- How to apply color stops in highcharter?
- How to apply custom color on candlesticks based on OPEN/CLOSE values?
- how to change color of highcharter candlestick stockchart?
- How can I apply different background color to entire tooltip for different series in highcharts
- How to apply color gradient in progress bar in high chart with stylemode in Angular
- How to use the tooltip formatter and still display chart color (like it does by default)?
- How to apply highchart's license
- How to change the text color in Highcharts
- r - How to set xlim and ylim range in a highcharter plot?
- How to apply borderRadius only for top side of Column or Bar in Highchart
- How to disable the on-hover color change in Highcharts?
- How to change bin width on R highcharter histogram
- Highcharts - how to disable color change on mouseover/hover
- How to set dataLabel Format and axis label angle in R highcharter package
- How to change series legend text color in HighChart chart?
- How do I remove the color swatch from my HighCharts legend without affecting the column?
- Need to apply background color to each legend text highchart
- How can i keep the color the same in highcharts
- How to change Highcharts xAxis label color individually?
- r- how to display the labels on the highcharter objects all the time
- How to hide color axis in heatmaps using highcharts
- How do I set the background color of a Highcharts HTML label?
- How can I change the scale of the legend in highcharter in R?
- How to build an Organization Chart with highcharter
- r highcharter package barplot group vs. color
- How to change area graph color above certain value in Highcharts
- Highcharts, how to change hover bg color for series with multiple columns (categories)
- Highchart / Highstock how to set color of individual ohlc or candle?
- How to change the palette colors of a highcharter column plot which depends on a variable?
- How to Change Highchart Column Color Dynamicly
More Query from same tag
- Reduce space between column in Highcharts
- HighCharts Column Range Data after json_encode
- Mark a point and draw plot lines in Multi Series Highchart
- showing ranks on yaxis in highchart in a manner that 1 is best and 50 is worst
- Json is syntax-valid, but the HighChart won't display series correctly
- How to dynamically remove the whole Column from a single series HighCharts column graph?
- How to apply highchart's license
- Highcharts Timeline inconsistent point width in multiple series
- Calculate percentage dynamically on click of legend
- Highcharts doesn't display all categories
- Show Marker symbol on the newest data in HightChart
- Highcharts Dynamic candlestick
- R Highcharter map with hc_motion
- How to apply the Renderer text() function multiple times to a Highcharts chart?
- how to set the interval of points on Y - Axis highcharts
- How to use html/unicode symbols as marker-symbols in highcharts?
- Highstock charts with Google Spreadsheet JSON
- How to make multiple Y-axis with incoming series of data from database using Highcharts
- Highstock navigator step like the parent chart
- Remove title based on viewport width
- how to disable highcharts animation on panning but still using on load
- Validate in Shiny doesn't work as expected when making a highcharter treemap
- Highstock Column Chart - data grouping causes data to scroll independently of axis
- Disable tooltip for one point?
- How to set correct xAxis time data in Highcharts?
- Highcharts - line chart dataLabels on every other point?
- Highcharts live graph setExtremes issue
- useUTC don't work
- Reading MySQL data into highstocks
- How do I implement solid colours for zone boundaries in Highcharts?