Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Simple Chart - Uncaught TypeError

    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]
    });

    #2
    Have you loaded the Charts Module?
    Last edited by Isomorphic; 13 Mar 2019, 12:13.

    Comment


      #3
      Thank you. Actually I have not loaded. So I will go ahead and load that.

      Comment


        #4
        It now works!!! Thank you. Yes, I now have included both of the following:

        <SCRIPT SRC="../isomorphic/system/modules/ISC_Drawing.js"></SCRIPT>
        <SCRIPT SRC="../isomorphic/system/modules/ISC_Charts.js"></SCRIPT>

        It seems using Charts.js does not require Analytics.js for what I need. I checked isomorphic 8.3 has Analytics.js but in 12.0 does not have Analytics.js file anymore.

        Thank you.

        Comment

        Working...
        X