library(plotly)
## Загрузка требуемого пакета: ggplot2
##
## Присоединяю пакет: 'plotly'
## Следующий объект скрыт от 'package:ggplot2':
##
## last_plot
## Следующий объект скрыт от 'package:stats':
##
## filter
## Следующий объект скрыт от 'package:graphics':
##
## layout
fig1 <- plot_ly(
type = "indicator",
mode = "gauge+number+delta",
value = 90,
title = list(text = "Percentage of planned sales
completed in October", font = list(size = 15)),
domain = list(x = c(0, 0.4), y = c(0, 1)),
delta = list(reference = 84),
gauge = list(axis = list(range = list(NULL, 100), tickwidth = 1, tickcolor = "darkblue"),
bar = list(color = "darkblue"),
bgcolor = "white",
borderwidth = 2,
bordercolor = "gray",
steps = list(list(range = c(0, 60), color = "lightblue"),
list(range = c(60, 85), color = "slateblue")),
threshold = list(line = list(color = "red", width = 4),
thickness = 0.75,
value = 90))) %>% layout(margin = list(l=20,r=30))
fig2 <- plot_ly(
type = "indicator",
mode = "gauge+number+delta",
value = 95,
title = list(text = "Percentage of planned sales
completed in November", font = list(size = 15)),
domain = list(x = c(0.6, 1), y = c(0, 1)),
delta = list(reference = 90),
gauge = list(axis = list(range = list(NULL, 100), tickwidth = 1, tickcolor = "darkblue"),
bar = list(color = "darkblue"),
bgcolor = "white",
borderwidth = 2,
bordercolor = "gray",
steps = list(list(range = c(0, 60), color = "lightblue"),
list(range = c(60, 85), color = "slateblue")),
threshold = list(line = list(color = "red", width = 4),
thickness = 0.75,
value = 84))) %>% layout(margin = list(l=20,r=30))
fig <- subplot(fig1, fig2)
fig
## Warning: 'layout' objects don't have these attributes: 'NA'
## Valid attributes include:
## '_deprecated', 'activeshape', 'annotations', 'autosize', 'autotypenumbers', 'calendar', 'clickmode', 'coloraxis', 'colorscale', 'colorway', 'computed', 'datarevision', 'dragmode', 'editrevision', 'editType', 'font', 'geo', 'grid', 'height', 'hidesources', 'hoverdistance', 'hoverlabel', 'hovermode', 'images', 'legend', 'mapbox', 'margin', 'meta', 'metasrc', 'modebar', 'newshape', 'paper_bgcolor', 'plot_bgcolor', 'polar', 'scene', 'selectdirection', 'selectionrevision', 'separators', 'shapes', 'showlegend', 'sliders', 'smith', 'spikedistance', 'template', 'ternary', 'title', 'transition', 'uirevision', 'uniformtext', 'updatemenus', 'width', 'xaxis', 'yaxis', 'barmode', 'bargap', 'mapType'