0
votes

I'm trying out angular-chart with Angular 1.5. I copied an example right off their home page:

<canvas id="line" class="chart chart-line" chart-data="data"
  chart-labels="labels" chart-series="series" chart-options="options"
  chart-dataset-override="datasetOverride" chart-click="onClick">
</canvas>

I even copied the sample JavaScript into my controller. Yet absolutely nothing shows up.

In angular-chart Bug #591, somebody else is having the same problem. I opened Bug #594 when that bug was closed.

Their site looks so professional---surely their library isn't broken! I must be making some stupid mistake. Any ideas?

(On second thought, looking at the GitHub project, it seems like it hasn't been updated for quite a while. Maybe I should try to find a different charting library for Angular.)

1
I gave up and switched to Angular-nvD3, built on top of NVD3, in turn built on top of D3 (although currently only D3 v3.x is supported). D3 is the hugely extensive, flexible, and popular data-driven document library which goes far beyond charts. It uses SVG, and the data representation for a scatter plot is more intuitive that Angular Chart. I'm pretty happy with it overall so far. - Garret Wilson

1 Answers

1
votes

okay, This might not make any sense. But I only put the canvas element within a div and it worked

The canvas needs to be in a div wrapper apparently .. hope it may help someone