MCPcopy Index your code
hub / github.com/apertureless/vue-chartjs

github.com/apertureless/vue-chartjs @v5.3.3 sqlite

repository ↗ · DeepWiki ↗ · release v5.3.3 ↗
63 symbols 164 edges 64 files 0 documented · 0% 9 cross-repo links
README

vue-chartjs

vue-chartjs logo

vue-chartjs is a wrapper for Chart.js in Vue. You can easily create reuseable chart components.

Supports Chart.js v4.

npm version codecov Build Status Package Quality npm Gitter chat license CDNJS version Known Vulnerabilities Donate ko-fi

QuickStart   •   Docs   •   Stack Overflow


Quickstart

Install this library with peer dependencies:

pnpm add vue-chartjs chart.js
# or
yarn add vue-chartjs chart.js
# or
npm i vue-chartjs chart.js

Then, import and use individual components:

<template>
  <Bar :data="data" :options="options" />
</template>

<script lang="ts">
import {
  Chart as ChartJS,
  Title,
  Tooltip,
  Legend,
  BarElement,
  CategoryScale,
  LinearScale
} from 'chart.js'
import { Bar } from 'vue-chartjs'

ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend)

export default {
  name: 'App',
  components: {
    Bar
  },
  data() {
    return {
      data: {
        labels: ['January', 'February', 'March'],
        datasets: [{ data: [40, 20, 12] }]
      },
      options: {
        responsive: true
      }
    }
  }
}
</script>

Need an API to fetch data? Consider Cube, an open-source API for data apps.

supported by Cube

Docs

Build Setup

# install dependencies
pnpm install

# build for production with minification
pnpm build

# run unit tests
pnpm test:unit

# run all tests
pnpm test

Contributing

  1. Fork it ( https://github.com/apertureless/vue-chartjs/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

This software is distributed under MIT license.

Buy Me A Coffee

Extension points exported contracts — how you extend this code

ExtendedDataPoint (Interface)
(no doc)
src/typedCharts.ts
ChartProps (Interface)
(no doc)
src/types.ts
ChartComponentRef (Interface)
(no doc)
src/types.ts

Core symbols most depended-on inside this repo

getRandomInt
called by 13
sandboxes/reactive/src/chartConfig.ts
createTypedChart
called by 9
src/typedCharts.ts
toRawIfProxy
called by 6
src/utils.ts
setLabels
called by 2
src/utils.ts
setDatasets
called by 2
src/utils.ts
plugins
called by 1
rollup.config.js
cloneProxy
called by 1
src/utils.ts
setOptions
called by 1
src/utils.ts

Shape

Function 47
Method 7
Class 6
Interface 3

Languages

TypeScript100%

Modules by API surface

test/setup.js10 symbols
src/utils.ts9 symbols
stories/chart.stories.ts7 symbols
src/typedCharts.ts4 symbols
src/chart.ts4 symbols
sandboxes/custom/src/components/LineWithLineChart.ts3 symbols
stories/scatter.stories.ts2 symbols
stories/reactive.stories.ts2 symbols
stories/radar.stories.ts2 symbols
stories/polarArea.stories.ts2 symbols
stories/pie.stories.ts2 symbols
stories/line.stories.ts2 symbols

Dependencies from manifests, versioned

@commitlint/cli18.0.0 · 1×
@commitlint/config-conventional18.0.0 · 1×
@rollup/plugin-node-resolve15.0.1 · 1×
@size-limit/preset-big-lib11.0.0 · 1×
@storybook/addon-actions6.5.16 · 1×
@storybook/addon-controls6.5.16 · 1×
@storybook/addon-docs6.5.16 · 1×
@storybook/addons6.5.16 · 1×
@storybook/builder-vite0.4.2 · 1×
@storybook/client-api6.5.16 · 1×
@storybook/client-logger6.5.16 · 1×
@storybook/vue36.5.16 · 1×

For agents

$ claude mcp add vue-chartjs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact