Movatterモバイル変換


[0]ホーム

URL:


CoreUI Angular Logo
Framework:
Getting startedIntroductionSupport CoreUICustomizeSassOptionsCSS VariablesLayoutBreakpointsContainersGridColumnsGuttersFormsOverviewAutocompletePRODate PickerPRODate Range PickerPROForm ControlSelectMulti SelectPROChecks & RadiosPassword InputPRORangeRange SliderPRORatingPROStepperPROInput GroupFloating LabelsLayoutTime PickerPROValidationComponentsAccordionAlertAvatarBadgeBreadcrumbButtonButton GroupCalendarPROCalloutCardCarouselClose buttonCollapseDropdownFooterHeaderImageList GroupLoading ButtonPROModalNavNavbarOffcanvasPaginationPlaceholderPopoverProgressSmart PaginationPROSmart TablePROSidebarSpinnerTableTabsNewToastTooltipWidgetsIconsChartsTemplatesNewAdmin & DashboardDownloadInstallationCustomizeContentMigrationv4 → v5v3 → v4Angular version


DownloadHire UsGet CoreUI PRO
On this page

Angular Charts Component

CoreUI Angular wrapper for Chart.js 4.x, the most popular charting library.


Installation

If you want to use our Chart.js Angular wrapper you have to install an additional package.

  • Chart.js v4.x librarychart.js
  • CoreUI Chart.js tooltip plugin and styles@coreui/chartjs
  • CoreUI Angular Chart.js component@coreui/angular-chartjs

Angular CLI

CoreUI v5.x Chartjs for Angular supportsng add to install all required dependencies for your Angular project.

ng add @coreui/[email protected]

NPM

Your other option is to usenpm install directly.

npm install chart.js@4npm install @coreui/chartjs@4npm install @coreui/[email protected]

Scss

Import custom CoreUI tooltip styles for Chart.js:

@use "@coreui/chartjs/scss/coreui-chartjs";

Chart types

Line Chart

A line chart is a way of plotting data points on a line. Often, it is used to show trend data, or the comparison of two data sets.Line Chart properties

Loading...
Loading...

Bar Chart

A bar chart provides a way of showing data values represented as vertical bars. It is sometimes used to show trend data, and the comparison of multiple data sets side by side.Bar Chart properties

Loading...
Loading...

Radar Chart

A radar chart is a way of showing multiple data points and the variation between them. They are often useful for comparing the points of two or more different data sets.Radar Chart properties

Loading...
Loading...

Doughnut and Pie Charts

Pie and doughnut charts are probably the most commonly used charts. They are divided into segments, the arc of each segment shows the proportional value of each piece of data.Doughnut and Pie Charts properties

Loading...
Loading...

Polar Area Chart

Polar area charts are similar to pie charts, but each segment has the same angle - the radius of the segment differs depending on the value.Polar Area Chart properties

Loading...
Loading...

Bubble Chart

A bubble chart is used to display three dimensions of data at the same time. The location of the bubble is determined by the first two dimensions and the corresponding horizontal and vertical axes. The third dimension is represented by the size of the individual bubbles.Bubble Chart properties

Loading...
Loading...

Scatter Chart

Scatter charts are based on basic line charts with the x axis changed to a linear axis. To use a scatter chart, data must be passed as objects containing X and Y properties. The example below creates a scatter chart with 4 points.Scatter Chart properties

Loading...
Loading...

API

import { ChartjsModule } from '@coreui/angular-chartjs';@NgModule({ imports: [   ChartjsModule,})export class AppModule(){}

c-chart

component

exportAs: cChart

Inputs:
namedescriptiontypedefault
customTooltipsEnables custom html based tooltipsbooleantrue
dataThe data passed to Chart.js chartChartDatarequired
optionsThe options object that is passed into the Chart.js chartChartOptionsundefined
pluginsThe plugins array that is passed into the Chart.js chartPluginOptionsByTypeundefined
redrawIf true, will tear down and redraw chart on all updatesbooleanfalse
typeChart.js chart type.keyof ChartTypeRegistrybar
wrapperPut the chart into the wrapper withdisplay: block.booleantrue
heightHeight attribute applied to the rendered canvas (px)numberundefined
widthWidth attribute applied to the rendered canvas (px)numberundefined
idHtml id attribute applied to the rendered canvasstringundefined

Outputs:
namedescription
chartRefReturns Chart reference when instantiated. Allows direct access to Chart API.
getDatasetAtEventProxy for Chart.js getDatasetAtEvent. Calls with dataset and triggering event.
getElementAtEventProxy for Chart.js getElementAtEvent. Calls with single element array and triggering event.
getElementsAtEventProxy for Chart.js getElementsAtEvent. Calls with element array and triggering event.

See also

CoreUI for Angular is Open Source UI Components Library for Angular.

Currently v5.5.17 Code licensed MIT, docs CC BY 3.0 .
CoreUI PRO requires acommercial license.


[8]ページ先頭

©2009-2025 Movatter.jp