vue-chartjs

Attach a custom plugin to Vue-Chart

倾然丶 夕夏残阳落幕 提交于 2021-02-08 08:47:43
问题 We need to attach a custom plugin to vue-chart. Please guide us how to implement on the same import { Line, mixins } from 'vue-chartjs' export default { namespaced: true, extends: Line, props: ['chartData', 'options'], mounted() { this.renderChart(this.chartData, this.chartData.options) } } This is how we are using the line chart of Vue-chart. How to attach the plugin here https://blog.larapulse.com/javascript/creating-chart-js-plugins We want to try this. But since we are using vue-chart

Attach a custom plugin to Vue-Chart

不羁岁月 提交于 2021-02-08 08:47:11
问题 We need to attach a custom plugin to vue-chart. Please guide us how to implement on the same import { Line, mixins } from 'vue-chartjs' export default { namespaced: true, extends: Line, props: ['chartData', 'options'], mounted() { this.renderChart(this.chartData, this.chartData.options) } } This is how we are using the line chart of Vue-chart. How to attach the plugin here https://blog.larapulse.com/javascript/creating-chart-js-plugins We want to try this. But since we are using vue-chart

Annotations are not displayed in Chart.js

主宰稳场 提交于 2021-01-29 08:58:08
问题 I'm sorry for my poor English. I'm trying to display a horizontal line in a graph using vue-chartjs and chartjs-plugin-annotation. The graph appears and the options are applied, but the horizontal line does not appear because the settings in the annotation are not working. If anyone knows how to fix this, please let me know. The version and code is as follows Chart.js v2.9.4 chartjs-plugin-annotation v0.5.7 Chart.js import { Bar } from 'vue-chartjs' import chartjsPluginAnnotation from

VueJS - How to implement the YTD (Year To Date) logic in order to do Date selection in Vue-Chartjs

僤鯓⒐⒋嵵緔 提交于 2021-01-29 08:09:27
问题 I am trying to implement a method for a Date selection in vue-chartjs. Here is the function that i have used in the methods life cycle hook: DateSelect(event) { const period = event.target.value let minValue = new Date(Math.max(...this.date) * 1000) const axisXMin = new Date(Math.min(...this.date) * 1000) switch (period) { case '1m': minValue.setMonth(minValue.getMonth() - 1) break case '3m': minValue.setMonth(minValue.getMonth() - 3) break case 'ytd': minValue.setFullYear(minValue

VueJS - How to implement the YTD (Year To Date) logic in order to do Date selection in Vue-Chartjs

主宰稳场 提交于 2021-01-29 08:03:42
问题 I am trying to implement a method for a Date selection in vue-chartjs. Here is the function that i have used in the methods life cycle hook: DateSelect(event) { const period = event.target.value let minValue = new Date(Math.max(...this.date) * 1000) const axisXMin = new Date(Math.min(...this.date) * 1000) switch (period) { case '1m': minValue.setMonth(minValue.getMonth() - 1) break case '3m': minValue.setMonth(minValue.getMonth() - 3) break case 'ytd': minValue.setFullYear(minValue

Is it possible to dynamically add chart type in the extends: property, based on props from parent component?

戏子无情 提交于 2020-07-03 09:00:22
问题 I have a vue chartjs component which imports the whole vue-chartjs library. My idea is, is it possible to somehow pass the type of the chart which I want and add it to the 'extends: VueCharts.charttype?.' In the example I provide it extends the VueCharts.Line, I need this property to be dynamically interpolated, passed from props. Is it possible this charttype to come from a parent props dynamically and how? <script> import { VueCharts } from "vue-chartjs"; export default { extends: VueCharts

Is it possible to dynamically add chart type in the extends: property, based on props from parent component?

半世苍凉 提交于 2020-07-03 08:59:49
问题 I have a vue chartjs component which imports the whole vue-chartjs library. My idea is, is it possible to somehow pass the type of the chart which I want and add it to the 'extends: VueCharts.charttype?.' In the example I provide it extends the VueCharts.Line, I need this property to be dynamically interpolated, passed from props. Is it possible this charttype to come from a parent props dynamically and how? <script> import { VueCharts } from "vue-chartjs"; export default { extends: VueCharts

ChartJs, How can I get different color fills between my two datasets in a line graph?

≡放荡痞女 提交于 2020-05-17 05:56:29
问题 Above is a graph I made using ChartJS. I have two datasets. I also have the space between the two datasets filled just like I want it. But I need to get two different colors for the fill. When the Hours dataset is bigger than the Goal dataset, I want the fill to be green, and when the Hours dataset is smaller than Goal, I want it to be red. I'm really hoping there is a way to do this using ChartJS, so that I don't have to recreate this in Canvas. If it matters, this is in Vue.Js. Here is the

Dynamically changing chart types with Vue Chart.js

戏子无情 提交于 2020-04-30 10:23:07
问题 I'm trying to use Vue Chart.js to implement a chart selector to visualise various data. Structure of application: ChartPicker.vue (allow user to pick chart, create data, use dynamic component key to re-render component) ChartWrapper.vue (receives props and passes them on, creates mixin for dynamic chart type) ChartRender.vue (simply renders chart) In the chart render component you usually you need to do 'extends: Bar', 'extends: Line' etc, therefore, requiring a ChartRender component type for

Dynamically changing chart types with Vue Chart.js

筅森魡賤 提交于 2020-04-30 10:23:06
问题 I'm trying to use Vue Chart.js to implement a chart selector to visualise various data. Structure of application: ChartPicker.vue (allow user to pick chart, create data, use dynamic component key to re-render component) ChartWrapper.vue (receives props and passes them on, creates mixin for dynamic chart type) ChartRender.vue (simply renders chart) In the chart render component you usually you need to do 'extends: Bar', 'extends: Line' etc, therefore, requiring a ChartRender component type for