I'm able to get QChart.js to work with pie charts without issues (as well as polar and doughnut charts), but whenever I try to create a line chart (as well as radar and bar charts) I get the following error:
TypeError: Cannot read property 'length' of undefined
The working code for pie charts is as follows:
Chart {
id: chart_line
Layout.fillHeight: true
Layout.fillWidth: true
chartType: Charts.ChartType.PIE
chartData: [
{value: 15, color: "#6AA84F"},
{value: 3, color: "#DC3912"},
{value: 5, color: "#FF9900"}]
}
The broken code for line charts is as follows:
Chart {
id: chart_line
Layout.fillHeight: true
Layout.fillWidth: true
chartType: Charts.ChartType.LINE
chartData: [
{labels: ["January","February","March","April","May","June","July"],
datasets: [{ data: [65,59,90,81,56,55,40]} ] }
]
}
My understanding is that I'm not loading in chartData properly. The charts I'm having issues with are all the ones that use lists in their declarations in QChartGallery.js. I'm not especially familiar with JavaScript and it seems something about my syntax is off and I can't find documentation to clarify.