Vue C3 Chart Component

1.2.11 · abandoned · verified Sun Apr 19

vue-c3 is a reusable Vue.js component designed to integrate C3.js charts into Vue 2 applications. It provides a declarative wrapper around the C3.js library, allowing developers to manage chart data and behaviors through Vue props and an event handler system. The current stable version is 1.2.11. Given its last commit in late 2018, the package is considered abandoned, with no active development, new features, or support for Vue 3 or recent C3/D3 versions. Its primary differentiator was simplifying C3 integration within the Vue 2 ecosystem, abstracting direct DOM manipulation typically required by C3.js. Release cadence was infrequent, with the last update over five years ago, indicating no ongoing maintenance.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to integrate vue-c3 into a Vue 2 component, initialize the chart with data, and manage its lifecycle events.

<template>
  <div>
    <vue-c3 :handler="handler"></vue-c3>
  </div>
</template>

<script>
  import Vue from 'vue'
  import VueC3 from 'vue-c3'

  export default {
    name: 'ChartComponent',
    components: {
      VueC3
    },

    data () {
      return {
        handler: new Vue()
      }
    },

    mounted () {
      const options = {
        data: {
          columns: [
            ['data1', 2, 4, 1, 5, 2, 1],
            ['data2', 7, 2, 4, 6, 10, 1]
          ]
        },
        axis: {
          x: {
            type: 'category',
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
          }
        }
      }
      this.handler.$emit('init', options)
    },
    beforeDestroy() {
      this.handler.$emit('destroy');
    }
  }
</script>

view raw JSON →