chart.js

ChartJs - Round borders on a doughnut chart with multiple datasets

别说谁变了你拦得住时间么 提交于 2020-12-30 03:33:11
问题 I have a regular Chartjs doughnut chart with multiple datasets, using this code for the dataset: datasets: [ { label: 'Bugs', data: [ 60 , 6.6666666666667 , 33.333333333333 ], backgroundColor: ['#25CFE4', '#92E7F1', '#eeeeee'], }, { label: 'Fixes', data: [ 60 , 0.44444444444444 , 39.555555555556 ], backgroundColor: ['#514463', '#8C75AB', '#eeeeee'], }, { label: 'Redesigns', data: [ 33.333333333333 , 10.37037037037 , 56.296296296296 ], backgroundColor: ['#1B745F', '#40C1A0', '#eeeeee'], } ] };

Dashed line for missing data in Chart.JS (spanGaps style)

匆匆过客 提交于 2020-12-29 13:21:52
问题 I have a chart with data points that are null. Chart.js does the correct thing and skips those data points but I would like to have a 'dashed' line fill in the missing parts. For example, in the below code the line should be solid as in the CodePen link, but should be dashed from "Blue" to "Yellow". I know the spanGaps option is available but I would like to apply a different style to it. Does anyone have any thoughts on how to accomplish this? I am using Chart.js 2.x var ctx = document

Dashed line for missing data in Chart.JS (spanGaps style)

半城伤御伤魂 提交于 2020-12-29 13:19:02
问题 I have a chart with data points that are null. Chart.js does the correct thing and skips those data points but I would like to have a 'dashed' line fill in the missing parts. For example, in the below code the line should be solid as in the CodePen link, but should be dashed from "Blue" to "Yellow". I know the spanGaps option is available but I would like to apply a different style to it. Does anyone have any thoughts on how to accomplish this? I am using Chart.js 2.x var ctx = document

Pause horizontal scrolling in chart.js for real time data

扶醉桌前 提交于 2020-12-13 12:07:33
问题 I am working on chart.js plugin with real time chart so i want to pause scrolling chart but when i calling pause dynamically its not working. pausestart:boolean; plugins: { streaming: { onRefresh: function(chart: any) { chart.data.datasets.forEach(function(dataset: any) { dataset.data.push({ x: Date.now(), y: Math.random() }); }); }, duration: 12000, refresh: 100, delay: 1000, frameRate: 60, pause: this.pausestart } } i am setting pausestart initially false after click on pause button set it

Pause horizontal scrolling in chart.js for real time data

心不动则不痛 提交于 2020-12-13 12:05:05
问题 I am working on chart.js plugin with real time chart so i want to pause scrolling chart but when i calling pause dynamically its not working. pausestart:boolean; plugins: { streaming: { onRefresh: function(chart: any) { chart.data.datasets.forEach(function(dataset: any) { dataset.data.push({ x: Date.now(), y: Math.random() }); }); }, duration: 12000, refresh: 100, delay: 1000, frameRate: 60, pause: this.pausestart } } i am setting pausestart initially false after click on pause button set it

Add buffer to Y axis with chart js

强颜欢笑 提交于 2020-12-13 05:40:47
问题 Sometimes chart value is the same height as chart height. For example im my picture red bar is 6, the same as y-axis top number. Can I add some buffer so chart bar never reaches top of y axis? Lets say y axis would go to 7 now (or similar). Image show my problem (open image in new window for better view) 回答1: By Axis Range Settings https://www.chartjs.org/docs/latest/axes/cartesian/linear.html#axis-range-settings suggestedMax: 7 1/2. Static max value example Change min to 10 and max to 90

Correct config location of chartjs-plugin-annotation with ng2-charts?

五迷三道 提交于 2020-12-13 03:12:36
问题 I'm using ng2-charts to draw a bar chart in my Angular application. At some point I had to add static lines to my charts, and I decided to use chartjs-plugin-annotation . Connecting these two libraries together is not well documented, but after some googling I was eventually able to get it working. Here is a minimalistic demo. Yet while it works well on stackblitz, the IDE on my local machine complains that annotation is not expected by ChartOptions interface: public barChartOptions:

Correct config location of chartjs-plugin-annotation with ng2-charts?

一个人想着一个人 提交于 2020-12-13 03:11:22
问题 I'm using ng2-charts to draw a bar chart in my Angular application. At some point I had to add static lines to my charts, and I decided to use chartjs-plugin-annotation . Connecting these two libraries together is not well documented, but after some googling I was eventually able to get it working. Here is a minimalistic demo. Yet while it works well on stackblitz, the IDE on my local machine complains that annotation is not expected by ChartOptions interface: public barChartOptions:

Correct config location of chartjs-plugin-annotation with ng2-charts?

旧巷老猫 提交于 2020-12-13 03:11:13
问题 I'm using ng2-charts to draw a bar chart in my Angular application. At some point I had to add static lines to my charts, and I decided to use chartjs-plugin-annotation . Connecting these two libraries together is not well documented, but after some googling I was eventually able to get it working. Here is a minimalistic demo. Yet while it works well on stackblitz, the IDE on my local machine complains that annotation is not expected by ChartOptions interface: public barChartOptions:

Vue ChartKick - different colours for bar chart

女生的网名这么多〃 提交于 2020-12-12 07:02:47
问题 I use a vertical bar chart and I want to specify different colors for each bar: main.js import Chartkick from 'vue-chartkick'; import Chart from 'chart.js'; Vue.use(Chartkick.use(Chart)); File.vue <column-chart :data="chartData" width="800px" :colors="['#0b6e00', '#006ca2', '#ff3333', '#d60001']"></column-chart> But only the first color is used and all bars have the same colour. I tried to pass a :library attribute with backGround colour parameter as well without luck. Line chart accepts