-
Notifications
You must be signed in to change notification settings - Fork 113
/
server.R
38 lines (34 loc) · 865 Bytes
/
server.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# server.R
x = movies$rating
minx = min(x)
maxx = max(x)
shinyServer(function(input, output) {
output$trendPlot <- renderGraph({
bins <- input$bins
trace1 <- list(x = x,
autobinx = FALSE,
xbins = list(start = minx,
end = maxx,
size = ((maxx-minx)/bins)
),
type = "histogram"
)
data <- list(trace1)
layout<- list(xaxis =
list(title = "Ratings",
range = c(minx, maxx),
autorange = FALSE,
autotick = FALSE,
tick0 = minx,
dtick = ((maxx-minx)/bins)
)
)
return(list(
list(id = "trendPlot",
task = "newPlot",
data = data,
layout = layout
)
))
})
})