Is there any way to set min, max and range values in Plotly. I want to set these values dynamically and allow the user to change.
Below is my sample code,
output$PLOT <- renderPlotly({
Data <- input_file()
if(startsWith(input$plotdata,"C")|startsWith(input$plotdata,"D")){
Data$group <- paste(Data$chip,Data$macro, Data$device, Data$temperature)
i=1
for(i in 1:length(input$chip)){
j=1
for (j in 1:length(input$macro)) {
k=1
for (k in 1:length(input$device)) {
l=1
for(l in 1:length(input$temperature)){
filtereddata <- Data[Data[,"chip"]==input$chip[i] &Data[,"macro"] == input$macro[j] & Data[,"device"] == input$device[k] & Data[,"temperature"] == input$temperature[l],]
combined <- rbind(combined,filtereddata)
l=l+1
}
k= k+1
}
j= j+1
}
i=i+1
}
#z <- combined[,"Leakage"] <- as.numeric(as.character(combined[,"Leakage"]))
#output$fileTable <- renderTable({
#NROW(combined)
#})
a <- list(
title = paste("Volts", "(V)"),
showticklabels = TRUE,
linecolor = toRGB("black"),
linewidth = 2,
zeroline = FALSE
)
b <- list(
title= paste("Amps"),
showticklabels= TRUE,
exponentformat = "e",
zeroline=FALSE,
linecolor = toRGB("black"),
linewidth = 2
)
if(startsWith(input$plotdata,"C")){
x <- combined[,input$varx] <- as.numeric(as.character(combined[,input$varx]))
y <- combined[,input$vary] <- abs(as.numeric(as.character(combined[,input$vary])))
CVPLOT <- plot_ly(combined, x=x, y=y, color = ~group, mode = "lines+markers")
CVPLOT <- CVPLOT%>%layout(xaxis=a, yaxis=b,annotations = list(x = 0.2 , y = 1.07, text = "DMACS CV Plot", showarrow = F, xref='paper', yref='paper'), showlegend = TRUE ,legend = list(font = list(size = 8)))
CVPLOT