Code Monkey home page Code Monkey logo

vue-frappe-chart's Introduction

Vue Frappe Charts

Vue logo

npm version

This is a simple vue wrapper for the frappe/charts package.

Supports Vue.js version 2 and 3.

Getting Started

Install via npm:

npm install vue-frappe-chart

Globally import / initialize:

import Vue from "vue"
import Chart from "vue-frappe-chart"

Vue.use(Chart)

or use the component directly:

import { VFrappeChart } from "vue-frappe-chart"

export default {
  components: {
    VFrappeChart,
  },
}

In our template:

<v-frappe-chart
  type="bar"
  :labels="['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']"
  :data="[{ values: [18, 40, 30, 35, 8, 52, 17, -4] }]"
  :colors="['red']"
/>

Resources

vue-frappe-chart's People

Contributors

carterbourette avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue-frappe-chart's Issues

Failed to execute 'removeChild' on 'Node': Runtime Error vue-frappe-chart

Facing runtime error on vue-frappe-chart, the error seems to occur frequently, but I couldn't figgure out an proper fix.

Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
at e.value (webpack-internal:///./node_modules/frappe-charts/dist/frappe-charts.min.esm.js:1572:36)
at e.value (webpack-internal:///./node_modules/frappe-charts/dist/frappe-charts.min.esm.js:1555:79)
at boundDrawFn (webpack-internal:///./node_modules/frappe-charts/dist/frappe-charts.min.esm.js:1513:20)
ERROR
Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
at e.value (webpack-internal:///./node_modules/frappe-charts/dist/frappe-charts.min.esm.js:1572:36)
at e.value (webpack-internal:///./node_modules/frappe-charts/dist/frappe-charts.min.esm.js:1555:79)
at boundDrawFn (webpack-internal:///./node_modules/frappe-charts/dist/frappe-charts.min.esm.js:1513:20)

screenshot

Screenshot 2023-11-08 at 5 40 23 PM (2)

Component wont accept camel-cased props

So if you pass camel-cased props like yMarkers, barOptions etc. the component does not recognize it.

The problem is Vue converts all camelcase props to ymarkers, baroptions etc. So in the parse() function in Chart.vue, these props are registered incorrectly.

BTW thank you for building this. It was very beneficial.

Error when using with Vite + Vue3: Could not resolve "./Chart"

X [ERROR] Could not resolve "./Chart"

    node_modules/vue-frappe-chart/src/components/index.js:1:33:
      1 │ export { default as Chart } from "./Chart"
        ╵                                  ~~~~~~~~~

11:51:16 [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/vue-frappe-chart/src/components/index.js:1:33: ERROR: Could not resolve "./Chart"
    at failureErrorWithLog (C:\Users\happy\Documents\GitHub\purecore\landing\node_modules\esbuild\lib\main.js:1605:15)
    at C:\Users\happy\Documents\GitHub\purecore\landing\node_modules\esbuild\lib\main.js:1251:28
    at runOnEndCallbacks (C:\Users\happy\Documents\GitHub\purecore\landing\node_modules\esbuild\lib\main.js:1034:63)
    at buildResponseToResult (C:\Users\happy\Documents\GitHub\purecore\landing\node_modules\esbuild\lib\main.js:1249:7)
    at C:\Users\happy\Documents\GitHub\purecore\landing\node_modules\esbuild\lib\main.js:1358:14
    at C:\Users\happy\Documents\GitHub\purecore\landing\node_modules\esbuild\lib\main.js:666:9
    at handleIncomingPacket (C:\Users\happy\Documents\GitHub\purecore\landing\node_modules\esbuild\lib\main.js:763:9)
    at Socket.readFromStdout (C:\Users\happy\Documents\GitHub\purecore\landing\node_modules\esbuild\lib\main.js:632:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
Vite Error, /node_modules/.vite/deps/vue-frappe-chart.js?v=232d0f16 optimized info should be defined

my component:

<template>
    <v-frappe-chart />
</template>
<script>
import { VFrappeChart } from "vue-frappe-chart"
export default {
    components: {
        VFrappeChart,
    },
}
</script>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.