Code Monkey home page Code Monkey logo

vue-css-donut-chart's Issues

Invalid prop "sections" error

when I update data(this is prop to donut-chart) I got the error like this:

//-------------------------------------------------- error here
app.js:55270 [Vue warn]: Invalid prop: custom validator check failed for prop "sections".

found in

---> at Donut.vue
at resources/assets/js/components/result/HospitalPieStatus.vue

//-------------------------------------------------- error here

this data is Array so I don't understand what's wrong
this(below) is my data and I use v-for statment this object and insert each array
to donut chart as prop

hospitalStatusNew2:Object
1:Array[3]
2:Array[3]
3:Array[3]
4:Array[3]

So I'm wondering if is this useful and right for dynamic data change and rendering

Sum of all the sections' values (100.00000000000001) should not exceed `total` (100)"

I recently stumbled upon this error. If I pass exactly this array to the chart receive this error
doesntWork =[{color: 'red', value:8.2}, {color: 'green', value:34.97}, {color: 'blue', value:30.6}, {color: 'yellow', value:26.23}]
But if I switch order of the array it works.
works = [{color: 'green', value:34.97}, {color: 'red', value:26.23}, {color: 'yellow', value:8.2}, {color: 'blue', value:30.6}, ]

When unit is set to %, diagram breaks.

Using In-browser resource

<script src="https://unpkg.com/vue-css-donut-chart"></script>

When unit is set to %, diagram breaks.

Had to revert to 1.0.2 version.

How to use with nuxt?

I try use with nuxt, but don't worked!

I'm importing inside of the component

index.vue

<template>
<vc-donut :sections="sections">Basic donut</vc-donut> 
< /template>

<script>
import Donut from "vue-css-donut-chart";
import "vue-css-donut-chart/dist/vcdonut.css";
Vue.use(Donut);

data() {
      return {
        sections: [{ value: 25 }, { value: 25 }]
      };
    }
</script>

Request: show each item count in legend

Hello, nice chart!

What about showing the total count for each section in the legend? Or even in a tooltip while hovering each slice?

My service is returning an array of objects, each contains it's value... so let's say there are 3 sections, first with value = 3, second = 3, third = 6, with this formula I've converted these values into percentages:

series_data.map(s => ({ 
    "label": s.label, 
    "value": s.value / data.total * 100, 
    color: s.color 
}))

Total is the sum of all the values. Yeah I know...it's easy but I think that would be nice to have it implemented as an option, in order to avoid this conversion every time. :-)

How can i use a variable to set the value?

I'm trying to set a chart, and the value of this chart is inside a variable, but i'm facing errors.
The variable is a float and is a valid value like "26.47".

Can please anyone can help me solve this issue?

Using Vue: 2.6.11, vue-css-donut-chart: 1.3.0 with vuetify 2.4.0;
image
image

No tests?

I've stumbled upon this component but I was wondering if there was any intention to add any test coverage to the code base

Animation

Hey excellent css donut chart!

I think the only thing it is missing is an animation for when the chart loads. Most donut charting libraries will bring the donut chart in slowly around the radius of the chart.

Anyway you could implement this quickly? I'm strapped for time but if you are also strapped for time I can submit a PR.

Best regards.

How to create custom tooltip/label in the chart

Im facing issue with this package is that it do not offers any way to create custom tooltip if there is any way can you assists me :) Btw its wonderful package to use donut chart having good options and easy to use too

Way to import the component directly to a SFC? Donut is undefined

Hi, first of - thank you for this amazingly looking, adequately simple component! Good job.

What I would like to do: I want to import and use the donut component similarly as I do with all of my own - just an import from a node_module, mentioning it as a component in the "components" field of Vue instance and then putting it into the template, passing props - similarly to the way it is done in this repo's demo page. I am using SFCs and TS.

What happened: Of course, an yarn add. If it should work out of the box as the above, then it did not on my end - I will gladly investigate the reasons further if that's the case. As I want the app to be self contained, I picked the ES6 method from the docs as the most adequate.

// main.ts

import Donut from 'vue-css-donut-chart';
import App from './App.vue';
import router from './router';
import store from './store/store';
import './registerServiceWorker';
import 'vue-css-donut-chart/dist/vcdonut.css';

Vue.use(Donut);

Vue.config.productionTip = false;

new Vue({
	router,
	store,
	render: (h) => h(App)
}).$mount('#app');

Imported the Donut and its styles inside my main.ts, did Vue.ues(Donut) before the new Vue is called and expected miracles, assuming it would be available from anywhere in my app. Of course it wasn't, referring to the Donut in the "components" vue instance field returns undefined without an explicit import into my SFC, which in turn seems contradictory to already importing it in the root instance. The way of importing the component into the SFC was not clear to me, too.

Vue docs suggest the way to enable access to the .vue file directly through the "browser" field in package.json, but it is not implemented it the package.

I thinks I am missing a piece in my Vue knowledge and I would very much appreciate someone enlightening me on the way to use this beautiful component in a vue-cli generated project.

Cheers 🍻

Center - Transparent Background

Would be great if the center of the donut had a transparent background. Haven't looked through the code for how it is currently implemented. Using this inside a striped table and want the table color to come through.

Bug with UI

Chart sections from the example below consists of 12 items with value equal to 8.33 for each. 8.33 * 12 = 99.96 For some reason though this is breaking UI in the middle of the chart (180 deg).
See https://jsfiddle.net/0g54jzwv/12/

Vue 3 usage

I tried using your package with vue 3, but it doesn't work properly
How do I set it up for vue 3

This is my code buh didn't work

import { createApp } from 'vue'
import App from './App.vue'
import Donut from 'vue-css-donut-chart';
import 'vue-css-donut-chart/dist/vcdonut.css';

const app = createApp(App)
app.use(Donut)
app.mount('#app')

Cannot read properties of undefined (reading '_c')

I've ran but show this error:
Cannot read properties of undefined (reading '_c')

My code:

import Donut from 'vue-css-donut-chart';

const app = createApp();
app.use(Donut);

...

<template>
  <vc-donut total="35">
    Test donut
  </vc-donut>
</template>

HTML in text field

Wouldn't it be better practice to have a field asking for enabling HTML and then enabling the use of v-html. than comparing the input format to be HTML and run a v-html to DonutHTML?

using start-angle prop causes artifact to appear on chart

(using Chrome 83)

image
As you can see in the upper right hand corner an artifact appears in the green section.

locally, my fix is to not use the start-angle prop, and instead override the .cdc class using translateZ

example:
transform: translateZ(1px) rotate(200deg);

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.