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

multiline - plots not animated and no legend #20

Closed shubhamsaini closed 9 years ago

shubhamsaini commented 9 years ago

I am trying to plot a multiline graph. Facing two issues:

  1. No Animation
  2. Legend not coming up

Below is my code: plotForecast <- data.frame(hourIndex=1:24,testHourP=1:24,d1P=25:48,enerDataP=49:72)

plotForecast %>% mjs_plot(x=hourIndex, y=testHourP) %>% mjs_line() %>% mjs_add_line(d1P) %>% mjs_add_line(enerDataP) %>%
mjs_add_legend(legend=c("X", "Y", "Z"))

EDIT: The program seems to be missing mjs_axis_x() function. Without using this function, multi-line plots do not animate.

hrbrmstr commented 9 years ago

It appears that there is an underlying assumption in the metrics-graphics js lib that the dynamic labels for the multi-line plots will be date-based. Not sure I'm going to be able to work around that.