Fixed #2838 that caused JS error when the jQuery plugin tried to add a chart to a jQuery selector that matched nothing.