Import of a single chart type module does not work correctly
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here
Current behavior
When importing a single chart type like PieChartModule
, the chart common components like tooltips are not working.
Expected behavior
<ngx-charts-pie-chart></ngx-charts-pie-chart>
should work correctly when importing PieChartModule
Reproduction of the problem https://plnkr.co/edit/5Ct4CiXVId7FRzlg5bG2
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Chart JS +ng2-charts not working on Angular+2 - Stack Overflow
I was facing the below-mentioned issue with charts. Error: node_modules/ng2-charts/lib/base-chart.directive.d.ts:17:23 - error TS2724: ' ...
Read more >Integration | Chart.js
Chart.js is tree-shakeable, so it is necessary to import and register the controllers, elements, scales and plugins you are going to use. # ......
Read more >Module Methods - webpack
This section covers all methods available in code compiled with webpack. When using webpack to bundle your application, you can pick from a...
Read more >JavaScript modules - MDN Web Docs
Use of native JavaScript modules is dependent on the import and ... Most servers already set the correct type for .js files, but...
Read more >Using TypeScript or ES6 – amCharts 4 Documentation
This must be put before everything else, or it won't work! ... Each chart-specific module will contain all classes that specific chart type...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@juarezpaf Hey there, I had to use a workaround.
Import the chart component:
Importing only that module will throw some errors on dev mode (I’ve mentioned here), so I’ve created a simple node script to inline external css from ngx-chart.
You have to run the script after the
npm install
the package
angular2-inline-template-style
will inline all ngx-charts componentsI hope it can useful! 😄
same here, @Luukschoen I think the modules should work on their own as well, shouldn’t they? There are probably a lot applications that don’t need every type of chart and they are all forced to take the much bigger payload as long as it isn’t working with the separate imports