The generatLegend() function only seems to work when a chart is created as follows:
var chart = new Chart(ctx).Line(data, ctxOptions);
var legend = chart.generateLegend();
The following does not work, and result in an "undefined is not a function" error:
var chart = new Chart(ctx);
chart.Line(data, ctxOptions);
var legend = chart.generateLegend();
Thats is not working in my chart.
I make an example in codepen: http://codepen.io/Haxz/pen/RNmJeW
chart.Line(...) doesn't modify your chart object in place, and the proto isn't updated with generateLegend() until after you've called a chart type on your chart object.
var chart = new Chart(ctx);
var lineChart = chart.Line(data, ctxOptions);
var legend = lineChart.generateLegend();
@KuroJoe is correct.
Most helpful comment
chart.Line(...) doesn't modify your chart object in place, and the proto isn't updated with generateLegend() until after you've called a chart type on your chart object.
var chart = new Chart(ctx);
var lineChart = chart.Line(data, ctxOptions);
var legend = lineChart.generateLegend();