score:1
Accepted answer
I guess you can just stick to the shiny logic and its reactive values. Check if this meets your needs:
library(shiny)
library(shinydashboard)
library(shinyWidgets)
library(dplyr)
library(tidyr)
library(shinyjs)
library(shinycssloaders)
library(shinytoastr)
library(highcharter)
library(pool)
ui <- fluidPage(
shinyjs::useShinyjs(),
# Main panel for displaying outputs ----
mainPanel(
highchartOutput("Plot", height = 600),
actionButton(inputId = "btn1", label = "increase width", class = "btn-primary"),
actionButton(inputId = "btn2", label = "decrease width", class = "btn-primary")
)
)
server <- function(input, output) {
size <- reactiveVal(1)
observeEvent(input$btn1, {
size(size() + 1)
})
observeEvent(input$btn2, {
# do not allow negative values
if(size() > 0){
size(size() - 1)
}
})
########### Plot1 ##########
output$Plot <- renderHighchart ({
highchart() %>%
hc_chart(type = "container",
zoomType= "x"
) %>%
#axis
hc_xAxis(type='datetime',
# categories=c(min2$datetime),
labels = list(rotation = 90,
format = '{value:%e-%b %H:%M}'),
showLastLabel = TRUE
) %>%
hc_yAxis(opposite = FALSE,
title = list(text = "Call Success"),
labels = list(format = "{value}%", style=list(fontSize='13px')), max = 100) %>%
hc_add_series(all_NoTime3, "spline", hcaes(x=datetime, y=percent, group=customer)
)%>%
hc_tooltip(valueDecimals = 1,
borderWidth=2,
xDateFormat= '<b> %y/%m/%d %H:%M:%S <b/>',
crosshairs = TRUE,
backgroundColor=' #eaecee ',
pointFormat = "Customer: <b> {series.name} <br> Success: <b> {point.y} %",
style=list(fontSize='14px')
)%>%
hc_plotOptions(spline =list(lineWidth = size(),
allowPointSelect = TRUE,
turboThreshold = 100,
cursor = 'pointer',
states = list(hover = list(lineWidth = 4)),
marker = list(enabled = F,
radius=1,
symbol="circle"))
) %>%
hc_credits(enabled = TRUE,
text = "CX & SE Center",
style = list(fontSize = "10px")
) %>%
hc_exporting(enabled = TRUE)
})
}
shinyApp(ui, server)
Source: stackoverflow.com
Related Query
- R Shiny Highchart, change line width on click
- how to reset Highchart chart width in percentage on Button click
- highcharts change rendered image source on click
- HighChart : plot line click event for multiple chart
- how to change color of line chart in highchart based on a categorical column in r?
- Highcharts -- how to change line width programmatically and prevent resetting line width?
- Highchart line chart with category do not occupy full width
- Highchart: is it possible to change the font of the label in Highchart via a click of a button?
- How do I change the line width of the area polygon in highchart?
- Is is possible to change line color in highchart xy plot for specific y range only?
- Make Highchart R the full width and height of the box in Shiny
- Unable to change Spiderweb in Highchart line color
- How to change color on the Highchart Sparkline line only?
- HighChart : plot line and plot click event
- Highcharts: export image show wrong color and line width if user change the color and/or line width
- How to change default line color in highchart stock GUI tools?
- Highchart specific width stack column bar graph
- How to display highchart series line marker symbol from tooltip formatter?
- Highchart - change color of one x-axis label only
- How to change the font family of Highchart to Bootstrap css default font family
- adapting text to highchart tooltip max width
- Highchart Area Range chart with gradient that follows the line
- Change color of bars depending on value in Highchart bar-chart with MVC3
- How can I change the width of the bars in a highchart?
- Call an angular component method when we click on highchart series
- I don't want circles in my line Highchart
- How to know information about the clicked bar in highchart column r shiny plot
- Stop HighCharts increasing width of line on hover
- programatically fire a click event for a point on highchart scatter plot
- How to change bin width on R highcharter histogram
More Query from same tag
- Highcharts Pie Chart ignores percentageDecimals tooltip setting and has floating point inaccuracy issue
- Highchart Rectangle Border Radius
- Highstocks Changing x axis tick from Feb DD. MMM to MMM DD
- Working with Highcharts using @ViewChildren
- Change height of Highcharts with JavaScript. By default only re-sizes on window re-size
- Import Highcharts and highcharts-more (AngularJS 1.5 + TypeScript + webpack)
- Highcharts Get rid off bottom line
- Highcharts gauge chart customization
- Hightcharts - Not showing column datalabels when chart type is column
- Mouse behavior buggy?
- HIghstock flags on first point is not rendered
- Stack area series on top of line series
- How to get time interval of candlestick in candlestick chart in highchart
- how to take only categories for x-axis and remove unwanted scaling in Highstock chart
- Javascript error: permission denied Highcharts IE8 jQuery AJAX
- Color the portions of chart using "Google 3D Pie chart API" in Android
- Extracting chart coordinates from touch events for custom HighCharts interaction
- Highcharts not displaying daily data for column chart
- Style highcharts x and y axis
- Spline graph with xAxis dateTime the line starts extremeleft/origin overlapping colorband on yAxis
- How to use Highcharts in typescript and react
- Drilldown in two steps, multiple choice in Highcharts
- Highcharts overwrite default DataLabel
- Highcharts: Add plotlines to legend
- How to make the highchart fully occupied with the div that had set?
- Highmaps redraw bug after update points (with enabled zoom)
- HighChart flags Data load issues
- Highcharts opacity of series color in line chart not active
- Highcharts Column Range - How to render series data stored in PHP variables?
- Highchart merge won't enable labels in xAxis