Skip to content
Snippets Groups Projects
Commit 39cbb43f authored by Berinda van Dijk's avatar Berinda van Dijk
Browse files

Simplified code in barplots, and bugfixes

parent 03918066
Branches
No related tags found
1 merge request!9Removed some graphs, and multiple changes in line graphs
......@@ -108,31 +108,25 @@ doId <- function(input) {
filter(points == max(points, na.rm = TRUE)) %>%
filter(time == min(time, na.rm=TRUE))
barplot_original <- ggplot(tabel_Prs, aes(fill = distance, y = points, x = stroke,
label=poolType, text=date)) +
barplot_uniform<-ggplot(tabel_Prs, aes(fill = distance, y = points, x = stroke, label=poolType, text=date)) +
geom_col(position = position_dodge2(preserve = "single")) +
scale_fill_manual(values=kleurenset_afstanden, limits=force)+
labs(title = "Prs: Punten per afstand per slag. Zowel lange - als kortebaan.")
barplot_original<-ggplotly(barplot_original, tooltip=c('label', 'text', 'y'))%>%
barplot_original<-ggplotly(barplot_uniform, tooltip=c('label', 'text', 'y'))%>%
layout(legend=list(orientation='h'), dragmode=FALSE)
appendPlotly(barplot_original)
barplot_rotatedlabels<-ggplot(tabel_Prs, aes(fill=distance, y=points, x=AfstandSlag,
label=poolType, text=date))+
geom_col(position=position_dodge2(preserve='single'))+
scale_fill_manual(values=kleurenset_afstanden, limits=force)+
theme(axis.text.x = element_text(angle = 45, hjust=1))+
labs(title = "Prs: Punten per afstand per slag. Zowel lange - als kortebaan.")
barplot_rotatedlabels<-barplot_uniform+
theme(axis.text.x = element_text(angle = 45, hjust=1))
barplot_rotatedlabels<-ggplotly(barplot_rotatedlabels, tooltip=c('label', 'text', 'y'))%>%
layout(dragmode=FALSE)
appendPlotly(barplot_rotatedlabels)
barplot_everydistance<-ggplot(tabel_Prs, aes(fill=distance, y=points, x=distance, label=poolType, text=date))+
geom_col(position=position_dodge2(preserve='single'))+
scale_fill_manual(values=kleurenset_afstanden, limits=force)+
labs(title = "Prs: Punten per afstand per slag. Zowel lange - als kortebaan.")+
barplot_everydistance<-barplot_uniform+
facet_grid(cols=vars(stroke), space ='free_x')
barplot_everydistance<-ggplotly(barplot_everydistance, tooltip=c('label', 'text', 'y'))%>%layout(legend=list(orientation='h'), dragmode=FALSE)
barplot_everydistance<-ggplotly(barplot_everydistance, tooltip=c('label', 'text', 'y'))%>%
layout(legend=list(orientation='h'), dragmode=FALSE)
appendPlotly(barplot_everydistance)
tabel_LastEntrys<-zonder_split%>%
......@@ -144,7 +138,7 @@ doId <- function(input) {
geom_col(position = position_dodge2(preserve = "single")) +
labs(title = "Laatste tijden: Punten >0 per afstand per slag", fill = "afstand")+
scale_fill_manual(values=kleurenset_afstanden, drop=TRUE, limits=force)
barplot_original_last<-ggplotly(norm_barplot_last, tooltip=c('y', 'label', 'text')) %>%
barplot_original_last<-ggplotly(barplot_original_last, tooltip=c('y', 'label', 'text')) %>%
layout(dragmode=FALSE, legend=list(orientation='h'))
appendPlotly(barplot_original_last)
......@@ -163,8 +157,8 @@ doId <- function(input) {
lijnenplot_ineen=ggplotly(ggplot(bovennul, aes(x = date, y = points, text=AfstandSlag,
color=interaction(distance, stroke, sep='m '),
linetype=poolType, shape=poolType)) +
labs(title = "Points, grouped by pooltype") +guides(shape='none', linetype='none')+
geom_line()+geom_point()+labs(color = "Distance & stroke")+ tooltip=c('date', 'points', 'text', 'shape'))
labs(title = "Points, grouped by pooltype", color='Distance & stroke') +guides(shape='none', linetype='none')+
geom_line()+geom_point(), tooltip=c('date', 'points', 'text', 'shape'))
naam_laatstgezien=''
for (i in 1:length(lijnenplot_ineen$x$data)){
goede_naam=substring(unlist(strsplit(lijnenplot_ineen$x$data[[i]]$name, ','))[1], 2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment