chart.js

Responsive chart growing uncontrollably

泪湿孤枕 提交于 2020-04-13 17:05:12
问题 I have a vue component that implements vue-chartjs's HorizontalBar component that I render as a cell in a bootstrap-vue table. My desire is to have the chart maintain a fixed height but scale horizontally as the window grows/shrinks. The chart plays nicely enough when the page is first loaded but grows uncontrollably on re-size to cover other elements on the page. How do I make them properly responsive without them going where they shouldn't? I'd also like to make sure they actually take up

Responsive chart growing uncontrollably

前提是你 提交于 2020-04-13 17:04:01
问题 I have a vue component that implements vue-chartjs's HorizontalBar component that I render as a cell in a bootstrap-vue table. My desire is to have the chart maintain a fixed height but scale horizontally as the window grows/shrinks. The chart plays nicely enough when the page is first loaded but grows uncontrollably on re-size to cover other elements on the page. How do I make them properly responsive without them going where they shouldn't? I'd also like to make sure they actually take up

Change Chartjs Legend Icon Style

时光总嘲笑我的痴心妄想 提交于 2020-04-13 03:53:11
问题 Hey guys I am trying change my Chartjs Icon legend style as shown from my screenshot, i'm not too sure if it is possible ? <!-- https://codepen.io/IrvingLee/pen/boqrEQ --> 回答1: Yes! It is possible. FIRST set the usePointStyle property to true for legend­ 's labels, in your chart options, like so : options: { legend: { labels: { usePointStyle: true } }, ... SECOND set pointStyle property (as per your requirement) for each of your dataset, as such : datasets: [{ ... pointStyle: 'line' }, { ...

Change Chartjs Legend Icon Style

一世执手 提交于 2020-04-13 03:52:10
问题 Hey guys I am trying change my Chartjs Icon legend style as shown from my screenshot, i'm not too sure if it is possible ? <!-- https://codepen.io/IrvingLee/pen/boqrEQ --> 回答1: Yes! It is possible. FIRST set the usePointStyle property to true for legend­ 's labels, in your chart options, like so : options: { legend: { labels: { usePointStyle: true } }, ... SECOND set pointStyle property (as per your requirement) for each of your dataset, as such : datasets: [{ ... pointStyle: 'line' }, { ...

Adding trendlines to existing chart Chart.js

泄露秘密 提交于 2020-04-10 17:58:17
问题 from hours I've been looking for a solution to add trendlines to an existing chart built with Chart.js I think we can only add logarithmic trendline on Chart.js ? I don't want to draw a trendline from scratch, but add 2 trendlines based on existing data of these 2 lines ; please see this fiddle example : THANK YOU https://jsfiddle.net/blueagency/p88mx3nw/ A big thank you in advance for all your help. 回答1: Currently, chart.js does not have a trendline capability at all (not even logarithmic).

Adding trendlines to existing chart Chart.js

允我心安 提交于 2020-04-10 17:58:05
问题 from hours I've been looking for a solution to add trendlines to an existing chart built with Chart.js I think we can only add logarithmic trendline on Chart.js ? I don't want to draw a trendline from scratch, but add 2 trendlines based on existing data of these 2 lines ; please see this fiddle example : THANK YOU https://jsfiddle.net/blueagency/p88mx3nw/ A big thank you in advance for all your help. 回答1: Currently, chart.js does not have a trendline capability at all (not even logarithmic).

Chart.js Line-Chart with different Labels for each Dataset

隐身守侯 提交于 2020-04-08 08:58:31
问题 Using Chart.js you can create line charts and for that you have to privde labels and datasets. for example: var data = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { label: "My First dataset", fill: false, lineTension: 0.1, backgroundColor: "rgba(75,192,192,0.4)", borderColor: "rgba(75,192,192,1)", borderCapStyle: 'butt', borderDash: [], borderDashOffset: 0.0, borderJoinStyle: 'miter', pointBorderColor: "rgba(75,192,192,1)", pointBackgroundColor: "

Chart.js Line-Chart with different Labels for each Dataset

人走茶凉 提交于 2020-04-08 08:58:09
问题 Using Chart.js you can create line charts and for that you have to privde labels and datasets. for example: var data = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { label: "My First dataset", fill: false, lineTension: 0.1, backgroundColor: "rgba(75,192,192,0.4)", borderColor: "rgba(75,192,192,1)", borderCapStyle: 'butt', borderDash: [], borderDashOffset: 0.0, borderJoinStyle: 'miter', pointBorderColor: "rgba(75,192,192,1)", pointBackgroundColor: "

Rounded corners on chartJS v.2 - bar charts (with negative values)

浪尽此生 提交于 2020-03-23 07:48:11
问题 I'm styling some chartjs bar charts which need rounded corners at the bar's values (not their base), In most cases this means rounded corners at the top of the bar's however there are also instances where the bars have negative values. I've used the answer here: How to create rounded bars for Bar Chart.js v2? provided by jordanwillis (https://stackoverflow.com/users/7581592/jordanwillis) which works great when values are positive but not when values are negative. See attached example: bars

(Vue, ChartJS) Create gradient background for chart from child component canvas context

无人久伴 提交于 2020-03-19 03:53:41
问题 I want to give my chart a gradient background color, but I can't access the canvas context as my chart gets rendered in a wrapper component I wrote. What I want to achieve: My actual wrapper rather looks like this: <script> import { Line, mixins } from "vue-chartjs"; const { reactiveProp } = mixins; export default { extends: Line, mixins: [reactiveProp], props: ["options"], components: {}, mounted() { // this.chartData is created in the mixin this.renderChart(this.chartData, this.options); }