Home Forums Chart Support PHP Example for Chart not working

PHP Example for Chart not working

Viewing 4 posts - 1 through 4 (of 4 total)
  • #45451

    Hello,

    I try to use this example in my CMS:
    https://canvasjs.com/php-charts/responsive-chart/

    I now get this error message:

    TypeError: Cannot read properties of undefined (reading 'getTime')
        at m._processMultiseriesPlotUnit (canvasjs.min.js:227:142)
        at m._processData (canvasjs.min.js:224:91)
        at m.setLayout (canvasjs.min.js:206:255)
        at m.render (canvasjs.min.js:219:141)
        at window.onload (backend-menue:35:15)
    canvasjs.min.js:227

    Even if I don’t use values with times.

    Here is my example url:
    Testpage

    Does someone has an idea what is wrong?

    Thanks
    vorlontech

    #45453

    vorlontech,

    The gallery example that you have shared seems to be working fine and we were not able to reproduce the issue at our end. Can you kindly share a complete code over Google-Drive or Onedrive reproducing the issue you are facing so that we can look into your code, run it locally at our end to understand the scenario better and help you out?

    —-
    Manoj Mohan
    Team CanvasJS

    #45454

    hi, I am working in October CMS and made a Component.

    Here is the PHP part:
    https://paste.laravel.io/b7eb89b4-54f2-4b6f-8c17-0c6a23a71e9b
    WE have the data on the HTML Part them in a variable “$dataPoints”.

    Here is the HTML part:
    https://paste.laravel.io/ef1fd220-0752-44ef-8867-2f02bdfb76be

    The “put styles” adds the code to right before the closing <head> and the “put scripts” ads the JS to the end of the <body>.

    #45543

    vorlontech,

    To pass the datapoints variables to html code, you can use json_encode and raw filter of twig. Please take a look at the working code-snippet below.

    dataPoints: {{ dataPoints | json_encode(constant('JSON_NUMERIC_CHECK')) | raw }}


    Manoj Mohan
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.