output$exercises_plot <- renderPlot({
if (input$metric == 'Sets') {
- ggplot(data = setsData()) +
+ p <- ggplot(data = setsData()) +
geom_bar(mapping = aes(x=Exercise, weight=Sets),
fill = '#00aaaa',
color = 'black') +
ylab('Sets')
} else {
- ggplot(data = selectedData()) +
+ p <- ggplot(data = selectedData()) +
geom_bar(mapping = aes(x=Exercise, weight=!!sym(input$metric)),
fill = '#00aaaa',
color = 'black') +
ylab(input$metric)
- }})
+ }
+
+ p +
+ theme_fivethirtyeight() +
+ theme(axis.text.x = element_text(angle = 30, hjust=1))
+ })
sumBreakdown <- reactive({
if(input$metric == 'Sets') {
output$history_plot <- renderPlot({
ggplot(data = historyData(), mapping = aes(x=Date, y=!!sym(input$metric))) +
geom_line() +
- geom_point()
+ geom_point() +
+ theme_fivethirtyeight()
})
})