hrbrmstr / metricsgraphics

:chart_with_upwards_trend: htmlwidget interface to the MetricsGraphics.js D3 chart library
http://hrbrmstr.github.io/metricsgraphics/
Other
132 stars 35 forks source link

Issue with plotting time series after enhancement #38

Open George-Koutsostamatis opened 8 years ago

George-Koutsostamatis commented 8 years ago

The data column for time has been formatted to date before plotting by: final$SAMPLED_DATE <- as.Date(final$SAMPLED_DATE,"%Y-%m-%d")

However, when trying to plot within Shiny, I receive the following error: Error in as.Date.default(mjs$x$data[, as.character(mjs$x$x_accessor)], : do not know how to convert 'mjs$x$data[, as.character(mjs$x$x_accessor)]' to class “Date”

Plotting a different column which is numeric works, it's just plotting with a date that doesn't work My code for the server side is: final %>% mjs_plot(x=SAMPLED_DATE, y=AROMATICS) %>% mjs_point()%>% mjs_labs(x="Date", y="Density")%>% mjs_axis_x(xax_format="date")-> m1 output$mjs1 <- renderMetricsgraphics(m1)

Any ideas why this error is popping up?