Working with the chart model

The chart component provides a visual representation of data using charts on a web page. PrimeNG chart components are based on the Charts.js 2.x library (as a dependency), which is a HTML5 open source library. The chart model is based on the UIChart class name, and it can be represented with the element name as p-chart.

The chart components will work efficiently by attaching a chart model file (chart.js) to your project. It can be configured as either a CDN resource, local resource, or CLI configuration:

  • CDN resource configuration:
      <script src="https://cdnjs.cloudflare.com/ajax/libs/
Chart.js/2.5.0/Chart.bundle.min.js"
></script>
  • Angular CLI configuration:
      "scripts": [ "../node_modules/chart.js/dist/
Chart.js"
, //..others ]

More about chart configuration and options is available in the official documentation of the Chart.js library (http://www.chartjs.org/).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.173.53