score:0

in the documentation, they have the datasource property nested like this.

options: {
    plugins: {
        datasource: {
            url: 'precipitation.csv'
        }
    }
}

does that make a difference?

score:1

the problem didn't come from your code. your project trie to access data from an external services and is blocked by cors policy. the simplest way to avoid this error is to execute your code in a local server. you can use this simple npm package (serve) or other to serve your code locally.

with the serve package the process is quite simple.

install serve package via npm

npm i -g serve

go to the root of your project and launch serve

serve

after the local server is initialise, you can access to it in your browser via the local ip provided.

moreover, i recommend you to use let or const (means that the identifier can’t be reassigned) instead of var since es2015.


Related Query

More Query from same tag