Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Help with CDN #214

Open
dkati opened this issue Mar 20, 2018 · 1 comment
Open

Help with CDN #214

dkati opened this issue Mar 20, 2018 · 1 comment

Comments

@dkati
Copy link

dkati commented Mar 20, 2018

good evening people.i am trying to use the cdn way (script link) and show a Pie chart but i cant

i dont use "require" commands neither "import"

thanks a lot

i tryed that :
https://stackoverflow.com/questions/40716800/using-library-without-require-when-using-cdn
but i got that error:
TypeError: (new Chart(...))[chartType] is not a function

My code:
var PieChart = window['react-chartjs'].Pie;

and at render() i got :

 <PieChart>
      data={mydata}
  </PieChart>
@agent3bood
Copy link

your render is wrong
try this

  render: function() {
    return <PieChart data={{
      labels: ["A", "B", "C"],
      datasets: [{ data: [1, 2, 3] }, { data: [9, 8, 7] }]
    }} options={{}} width="600" height="250"/>
  }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants