I am trying to implement chart in our project. So I started with a simple chart in the demo. I am getting an Uncaught TypeError: Cannot read property 'create' of undefined for 'isc.FacetChart.create'.
Am I missing something that I am supposed to have had included please?
var chartData = [
{region: "West", product: "Cars", sales: 37},
{region: "North", product: "Cars", sales: 29},
{region: "East", product: "Cars", sales: 80},
{region: "South", product: "Cars", sales: 87}
]
isc.FacetChart.create({
ID: "simpleChart",
facets: [{
id: "region",
title: "Region"
},{
id: "product",
title: "Product"
}],
data: chartData,
valueProperty: "sales",
chartType: "Area",
title: "Sales by Product and Region"
});
isc.DynamicForm.create({
ID: "chartSelector",
items: [{
name: "chartType",
title: "Chart Type",
type: "select",
valueMap: ["Area", "Column", "Bar", "Line", "Pie", "Doughnut", "Radar"],
defaultValue: "Area",
changed : function (form, item, value) {
simpleChart.setChartType(value)
}
}]
});
chartSelector.observe(simpleChart, "setChartType", "chartSelector.getItem('chartType').setValue(simpleChart.chartType)");
isc.VLayout.create({
ID: "simpleChartLayout",
width: "100%",
height: "100%",
membersMargin: 20,
members: [chartSelector, simpleChart]
});
Am I missing something that I am supposed to have had included please?
var chartData = [
{region: "West", product: "Cars", sales: 37},
{region: "North", product: "Cars", sales: 29},
{region: "East", product: "Cars", sales: 80},
{region: "South", product: "Cars", sales: 87}
]
isc.FacetChart.create({
ID: "simpleChart",
facets: [{
id: "region",
title: "Region"
},{
id: "product",
title: "Product"
}],
data: chartData,
valueProperty: "sales",
chartType: "Area",
title: "Sales by Product and Region"
});
isc.DynamicForm.create({
ID: "chartSelector",
items: [{
name: "chartType",
title: "Chart Type",
type: "select",
valueMap: ["Area", "Column", "Bar", "Line", "Pie", "Doughnut", "Radar"],
defaultValue: "Area",
changed : function (form, item, value) {
simpleChart.setChartType(value)
}
}]
});
chartSelector.observe(simpleChart, "setChartType", "chartSelector.getItem('chartType').setValue(simpleChart.chartType)");
isc.VLayout.create({
ID: "simpleChartLayout",
width: "100%",
height: "100%",
membersMargin: 20,
members: [chartSelector, simpleChart]
});
Comment