Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@coreui/vue-chartjs

coreui88.6kMIT3.0.0TypeScript support: included

Vue component wrapper for Chart.js

coreui, chart.js, vue chart.js, coreui-vue, vue charts, vue chart components, layout, charts, vue chart.js implementation, component

readme

CoreUI logo

CoreUI Vue.js wrapper for Chart.js

Explore @coreui/vue-chartjs docs & examples »

Report bug · Request feature · Blog

Status

npm package NPM downloads

install:
npm install @coreui/vue-chartjs

# or

yarn add @coreui/vue-chartjs
import:
import { CChart } from '@coreui/vue-chartjs'

or

import {
  CChart,
  CChartBar,
  CChartHorizontalBar,
  CChartLine,
  CChartDoughnut,
  CChartRadar,
  CChartPie,
  CChartPolarArea,
} from '@coreui/vue-chartjs'
props:
/**
 * Enables custom html based tooltips instead of standard tooltips.
 *
 * @default true
 */
customTooltips: {
  type: Boolean,
  default: true,
  required: false,
},
/**
 * The data object that is passed into the Chart.js chart (more info).
 */
data: {
  type: [Object, Function] as PropType<ChartData | ((canvas: HTMLCanvasElement) => ChartData)>,
  required: true,
},
/**
 * Height attribute applied to the rendered canvas.
 *
 * @default 150
 */
height: {
  type: Number,
  default: 150,
  required: false,
},
/**
 * ID attribute applied to the rendered canvas.
 */
id: {
  type: String,
  default: undefined,
  required: false,
},
/**
 * The options object that is passed into the Chart.js chart.
 *
 * {@link https://www.chartjs.org/docs/latest/general/options.html More Info}
 */
options: {
  type: Object as PropType<ChartOptions>,
  default: undefined,
  required: false,
},
/**
 * The plugins array that is passed into the Chart.js chart (more info)
 *
 * {@link https://www.chartjs.org/docs/latest/developers/plugins.html More Info}
 */
plugins: {
  type: Array as PropType<Plugin[]>,
  default: undefined,
},
/**
 * If true, will tear down and redraw chart on all updates.
 */
redraw: Boolean,
/**
 * Chart.js chart type.
 *
 * @type {'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie' | 'scatter'}
 */
type: {
  type: String as PropType<ChartType>,
  default: 'bar',
  required: false,
},
/**
 * Width attribute applied to the rendered canvas.
 *
 * @default 300
 */
width: {
  type: Number,
  default: 300,
  required: false,
},
/**
 * Put the chart into the wrapper div element.
 *
 * @default true
 */
wrapper: {
  type: Boolean,
  default: true,
  required: false,
},
usage:
<CChartLine
  :wrapper="false"
  :data="{
    labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
    datasets: [
      {
        label: 'My First dataset',
        backgroundColor: 'rgba(220, 220, 220, 0.2)',
        borderColor: 'rgba(220, 220, 220, 1)',
        pointBackgroundColor: 'rgba(220, 220, 220, 1)',
        pointBorderColor: '#fff',
        data: [40, 20, 12, 39, 10, 40, 39]
      },
      {
        label: 'My Second dataset',
        backgroundColor: 'rgba(151, 187, 205, 0.2)',
        borderColor: 'rgba(151, 187, 205, 1)',
        pointBackgroundColor: 'rgba(151, 187, 205, 1)',
        pointBorderColor: '#fff',
        data: [50, 12, 28, 29, 7, 25, 12]
      }
    ]
  }"
/>

changelog

Changelog

3.2.11

21 May 2021

Changed

  • chore: dependencies update da10ba8
  • test(CDataTable): snapshot update d1198cd
  • test(CDropdown): emits click on split button click 807eba6
  • Add new function to emit on splitButtonPress adba664
  • fix(CDataTable): rtl margins for labels and cleaner icon 578a76c
  • feat: additional dialog classes property for CModal.vue 0253d98
  • chore: 3.2.11 version release f0c5210
  • Fix RTL direction margin 3b9ea32
  • fix(CModal): add scrollable prop to index.d.ts f9d15ba

Fixed

  • feat(CDropdown): emit event on split dropdown button click - close #134 close #135 - thanks @rabrowne85 #134 #135
  • fix(CDataTable): striped style not working with details slot #127 #77
  • fix(CDataTable): v-else without v-if breaking Parcel - thanks @adamshaylor #143 #144
  • Merge fix(CDataTable): rtl margins - closes #145 thanks @seddighi78 #145

    3.2.9

11 March 2021

Changed

  • chore: dependencies update 58808fc
  • chore: 3.2.9 version release 9ffeb6a
  • chore(workflows): update bb86013
  • chore: merge user pull request #141 45483c5
  • fix(CDataTable): fixed issue with loading/no-items-slot 91024bc

3.2.7

17 December 2020

Changed

  • chore: 3.2.7 version release 94bb062
  • fix(CToast): add missing color prop 1401dee
  • chore: dependencies udate b54b77f
  • fix(CToast): rtl margins for header and CButtonClose 0d0c6c0

3.1.6

11 December 2020

Changed

  • fix(CTooltip): tooltip shows up on title update 6d1ba6c
  • chore: 3.1.6 version release 85dfea5

3.1.5

7 December 2020

Changed

  • chore: dependencies update dd02660
  • chore: project checks update 599dc2e
  • fix(CTooltip): add missing updateTitle functionality ae9d901
  • chore: 3.1.5 version release 9d64c71

3.1.4

26 October 2020

Changed

3.1.3

26 October 2020

Changed

3.1.2

24 July 2020

Changed

  • chore: 3.1.2 version release 3c8c082
  • fix: CDataTable disable auto removing columnFilter #113 f2c6ebe

3.1.1

8 July 2020

Changed

  • chore: 3.1.1 version release: update dependencies and changelog 4fff8d2
  • chore: update changelog to 3.1.0 a504c71
  • fix: CModal: 'update:show' event - add third argument 'accept' #92 a91e4fd

3.1.0

3 July 2020

Changed

  • chore: 3.1.0 version release: update dependencies and changelog b95424f
  • feat: CDataTable: replace cleaner prop object with slot 8976054
  • feat: CDataTable: add cleaner prop, update @coreui/icons cf58305
  • feat: CProgress: add size prop a056973
  • fix: CDataTable: add aria-label attributes to inputs ede894f
  • feat: CListGroup: add accent functionality 94256a1
  • chore: fix VSCode hints generator 433a574
  • fix: CSidebarNavItem: fix icon computation 02d5ffd
  • feat: CNav component: add tag prop and vertical breakpoint option 9aa2400
  • feat: add CListGroupItemDivider wrapper component 1a64352
  • feat: CSidebarNavItem: add color prop 3bb6c1f
  • chore: update eslint rules and snapshots 833d98a
  • fix: CDropdown: fix split button dropdowns positioning 7bc7f96
  • chore: update workflows 04efc0f
  • refactor: CPagination: correct item key assignment 2b1828c
  • chore: update snapshot 5fa9531
  • feat: CWidgetIcon: add footer slot 0e63428

3.0.12

2 June 2020

Changed

  • chore: 3.0.12 release: fix dependency @coreui/icons-vue a3c90f3

3.0.11

28 May 2020

Changed

  • chore: 3.0.11 release: update packages 0b4e388
  • chore: update eslint-plugin-vue 95d59a1
  • chore: downgrade eslint dd5544e
  • chore: lock @vue/test-utils version 2c954b5
  • fix: CSelect: change input event to change, due to IE/edge support lack ef84a23

3.0.10

19 May 2020

Changed

  • chore: 3.0.10 release: fix typings 98f53db

3.0.9

18 May 2020

Changed

  • fix: update package-lock.json 7062b4a
  • chore: 3.0.9 release: update dependencies, fix typings 2bd63ff
  • fix: CTooltip, CPopover: add legacy styles f3e81d5
  • test: update 080843f
  • fix: downgrade eslint 7acfab3
  • fix: fix hints generating script 5bfe25c

3.0.8

5 May 2020

Changed

  • chore: 3.0.8 release 40a6ca9
  • fix: CSidebarNavItem: allow adding 'size' prop in 'icon' object #76 a1a8203
  • fix: CSidebarNavDropdown: allow adding 'size' prop in 'icon' object #76 30ae677
  • chore: update CSelect snapshot d5c600b
  • fix: CSelect: fix assigning falsy value #83 00574cf
  • fix: CSelect: allow restoring placeholder after reseting value 02b0e5a

3.0.7

8 April 2020

Changed

  • chore: 3.0.7 release - update dependencies 44244fd
  • chore: 3.0.7 version release - update typings #80 58f3e45

3.0.6

7 April 2020

Changed

  • chore: 3.0.6 release - update dependencies 2c6927e
  • fix: CDataTable: fix header styles: 603af02
  • fix: CDropdownItem: fix closing dropdown when item is router link #79 0492be9
  • feat: CDataTable, row-clicked event - add event object as argument 89c1f8b
  • chore: CBadge: delete doubled classes 4c29500
  • fix: CInputCheckbox: always render even empty label in custom mode f74ec0a
  • fix: CDataTable: 'fixed' prop class name correction ea4a5bd

3.0.5

18 March 2020

Changed

  • chore: delete build files 269128b
  • chore: 3.0.5 version release - update dependencies dd2971f
  • feat: add CInputRadioGroup component af899f5
  • feat: CCollapse: add possibility of different duration of show and hide 288fcc9
  • feat: CDataTable: add noItemsView prop #67 79d6e11
  • test: CDataTable tests update 4d658b2
  • fix: CCollapse: fix blinking when animation duration is 0ms ed0d5fa
  • feat: CDataTable: add 'external' key to itemsPerPageSelect prop object 2323eaa
  • fix: CInputRadioGroup: add inline styling option 9f8aeec
  • feat: CPagination: add arg 'reduced' to the 'update:activePage' event c94cb09
  • feat: CDataTable: add thead-top slot f130496
  • chore: fix typings ce18118

3.0.4

9 March 2020

Changed

  • fix: fix package dependencies 2cdd679
  • chore: update build files df938ef
  • chore: update project, add comment fd7f075

3.0.3

9 March 2020

Changed

  • chore: 3.0.3 release - update dependencies and build files fe1a61b
  • fix: CDropdownItem: restore functional component events #73 311d18e

3.0.2

6 March 2020

Changed

  • chore: 3.0.2 release: update dependencies and build files 31ffedb
  • fix: CDropdown: close dropdown on every dropdown-item-click event #71 ed04296
  • fix: CDropdown: close dropdown on every dropdown-item-click event #72 cffd7c4
  • chore: fix typings 67f7cef
  • fix: do not emit update:value in case of 'multiple' attribute #64 73d2b3f
  • refactor: change CDropdown closing event name 26c2f7d

3.0.1

28 February 2020

Changed

  • chore: 3.0.1 release - update dependencies and build files b6f44c9
  • refactor: CDropdown: optimize dropdown hiding, update tests b295f71
  • feat: CDataTable row-clicked event modification #59 2a89938
  • fix: always close overlaid sidebar on outside click 1b43afa
  • feat: add CClickaway directive a78fd14
  • refactor: remove listners function from form-mixins 149c6c6
  • fix: form components - add missing events 7eaec17
  • feat: CDataTable: add page-change event 9161fd6
  • chore: update readme and issue template 9779c01
  • chore: update typings bdb4b64
  • chore: update build worklow shield in README 7aad5d4
  • chore: merge user pull request 31315c6
  • chore: update README ad9f36c