chart.js

Chart.js compress vertical axis on barchart

江枫思渺然 提交于 2021-02-04 22:15:49
问题 I have a dataset in which the last value is always very high. This causes an issue with my bar chart; almost all the other values are hard to get a feeling for without hovering over them. Here is a screenshot: This is what I am trying to achieve; So my question; is this possible within vanilla Chart.js or do I need a plugin? And if so; is there an existing plugin or do I need to write one myself? I am also open for alternative solutions to the initial problem. I've looked all over the

Chart.js compress vertical axis on barchart

眉间皱痕 提交于 2021-02-04 22:15:12
问题 I have a dataset in which the last value is always very high. This causes an issue with my bar chart; almost all the other values are hard to get a feeling for without hovering over them. Here is a screenshot: This is what I am trying to achieve; So my question; is this possible within vanilla Chart.js or do I need a plugin? And if so; is there an existing plugin or do I need to write one myself? I am also open for alternative solutions to the initial problem. I've looked all over the

How to plot a single value with line in line chart graph using charts.js?

雨燕双飞 提交于 2021-02-04 08:39:05
问题 I need to plot a single value in line chart. Currently i am using charts.JS library for line graph purpose. The data will be varied some times i'll get the single data inside the data set at that time i need to plot the single value with line in the line chart. I tried with the charts.js annotation plugin but it wasn't met my requirements. which is like it wis overlapping the plotted point in the graph area. CODE WHICH I HAD TRIED createLineChart() { this.lineChart = new Chart(this.lineCanvas

is there a way to do automatic scrolling?

非 Y 不嫁゛ 提交于 2021-02-04 08:38:07
问题 Kian here, I'm trying to put data into chartJS and have it automatically scroll when it reaches the end so like when it reaches here it will keep adding data without the user having to scroll, is there any ways that I can do this without the scroll bar at the bottom? 回答1: Automatic scrolling without visible scroll bar would means that the user can never see data again that was scrolled out of the visible area. If this is what you want, you can simply remove outdated labels and dataset values

is there a way to do automatic scrolling?

折月煮酒 提交于 2021-02-04 08:38:05
问题 Kian here, I'm trying to put data into chartJS and have it automatically scroll when it reaches the end so like when it reaches here it will keep adding data without the user having to scroll, is there any ways that I can do this without the scroll bar at the bottom? 回答1: Automatic scrolling without visible scroll bar would means that the user can never see data again that was scrolled out of the visible area. If this is what you want, you can simply remove outdated labels and dataset values

Reduce spacing between bars in horizontal bar chart (chart.js)

无人久伴 提交于 2021-01-29 18:18:15
问题 I have the following horizontal bar chart <template> <div> <canvas id="myChart" width="100" height="100"></canvas> </div> </template> <script> import Chart from 'chart.js'; export default { data() { return { ctx: null, chart: null, } }, mounted() { this.ctx = document.getElementById('myChart'); this.chart = new Chart(this.ctx, { type: 'horizontalBar', data: { labels: ['1', '2', '3', '4', '5'], datasets: [{ categoryPercentage: 0.4, label: 'Stars', data: [15, 28, 34, 48, 100], backgroundColor:

Chartjs gradient background color based on min and max values

ぃ、小莉子 提交于 2021-01-29 15:42:04
问题 I'm using chartjs with vue-chart to display some data in my application and actually what I would like to achieve is to have a Bar chart with a background color from red to green. The chart has dynamic min and max values but it cannot be less than 0 and greater than 5. Similar to a 5 star rating. In order to show differences in the displayed data I'm not fixing the chart min/max from 0 to 5. Currently this is the code to show my chart: Options: min is -0.2 than minimum value but not less than

Chart.js does not display any data

人盡茶涼 提交于 2021-01-29 14:22:44
问题 I have a data coming from the server in the following format: [ { name: "series1" series: [ { date: "2016-01-31T00:00:00.000Z", value: 49 }, { date: "2016-02-28T00:00:00.000Z", value: 49 }, { date: "2016-03-30T00:00:00.000Z", value: 44 }, { date: "2016-04-31T00:00:00.000Z", value: 57 } ] } { name: "series2" series: [ ... ] } ] Every point in the series above represent monthly data Here is my chart declaration: this.ctx = this.myChartRef.nativeElement.getContext('2d'); let myChart = new Chart

Django and Chart.js Not Rendering Graph Correctly

試著忘記壹切 提交于 2021-01-29 09:01:23
问题 So I spent the weekend testing and searching SO and finally got Django and Chart.js working. Kind of. It renders the graph but the data is not correct. When I loop through the object, the results are not what I would expect. Maybe I'm blind from staring at this all weekend. Would appreciate any pointers. Here are my views... class ChartView(LoginRequiredMixin, TemplateView): template_name = 'Books/chart.html' def get_context_data(self, **kwargs): context = super(ChartView, self).get_context

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