ngx-charts
Primary version
Primary version
  • Introduction
  • Changelog
  • Custom Charts
  • demo
  • Features
  • Installing
  • License
  • Motivation
  • Table of contents
  • contributing
    • Building
    • Community
    • Credits
    • Guidelines
    • Troubleshooting
  • examples
    • Box Chart
    • bubble-chart
    • Gauge Chart
    • Heat Map Chart
    • Linear Gauge Chart
    • Number Card Chart
    • Polar/radar Chart
    • Tree Map Chart
    • bar-charts
      • Grouped Horizontal Bar Chart
      • Grouped Vertical Bar Chart
      • Horizontal Bar Chart
      • Normalized Horizontal Bar Chart
      • Normalized Vertical Bar Chart
      • Stacked Horizontal Bar Chart
      • Stacked Vertical Bar Chart
      • Vertical Bar Chart
    • line-area-charts
      • Area Chart
      • Line Chart
      • Normalized Area Chart
      • Stacked Area Chart
    • pie-charts
      • Advanced Pie Chart
      • Pie Chart
      • Pie Grid Chart
Powered by GitBook
On this page

Motivation

PreviousLicenseNextTable of contents

Last updated 5 years ago

D3 is a great library and works really well, so why go through all the effort to use Angular to draw the SVGs vs. just creating a wrapper?

When we first started this project internally some two years ago, we did exactly that (yes, the core features of this library have been used in a production app for over two years now). It was very difficult to create highly reusable charts and the code was not clear.

Additionally, if we created a wrapper we would violate a core principle of frameworks like Angular or React, where there should only be one framework touching the DOM. If you have multiple libraries touching the DOM, things can get out of sync and create unpredictable results.

By creating charts using Angular components, it lets you create very composable charts with high reuse of common elements like axis, bars, circles, etc. It makes it even easier to extend to add capabilities or .

compose advanced charts using a combination of components