chart.js

How to build a time x-axis where it starts on Monday and ends on Sunday for scatter plot in chartJS?

风格不统一 提交于 2020-07-23 06:48:06
问题 I am building a scatter plot using chartJS and react-chartjs-2. I am getting time in this format 2020-07-06T09:17:15.424+00:00 for x-axis and simple floats for y-axis. However I would only like to map data on x-axis based on the day of the week and the time. I have written this for data right now. For the data should the x-axis data be a string or a moment object in order to display data on the weekdays? What kind of data do I need to pass to only show where the point stands in a week? export

How to build a time x-axis where it starts on Monday and ends on Sunday for scatter plot in chartJS?

陌路散爱 提交于 2020-07-23 06:46:27
问题 I am building a scatter plot using chartJS and react-chartjs-2. I am getting time in this format 2020-07-06T09:17:15.424+00:00 for x-axis and simple floats for y-axis. However I would only like to map data on x-axis based on the day of the week and the time. I have written this for data right now. For the data should the x-axis data be a string or a moment object in order to display data on the weekdays? What kind of data do I need to pass to only show where the point stands in a week? export

Django - object is not subscriptable django charts.js" or nothing displays at all?

限于喜欢 提交于 2020-07-23 06:33:20
问题 i'm trying to display data on my charts using some model values and charts.js. My values are a country field and a class method that i'm not sure how I'm to call it. I keep getting the error "TypeError: 'Organization' object is not subscriptable django charts.js" or nothing displays at all. Please help. models.py from django_countries.fields import CountryField class Organization(models.Model): country = CountryField(blank_label='(select country)') def Total_Score(cls): Total_Score = cls

Django - object is not subscriptable django charts.js" or nothing displays at all?

岁酱吖の 提交于 2020-07-23 06:31:10
问题 i'm trying to display data on my charts using some model values and charts.js. My values are a country field and a class method that i'm not sure how I'm to call it. I keep getting the error "TypeError: 'Organization' object is not subscriptable django charts.js" or nothing displays at all. Please help. models.py from django_countries.fields import CountryField class Organization(models.Model): country = CountryField(blank_label='(select country)') def Total_Score(cls): Total_Score = cls

Stacked Floating Horizontal Bar using ChartJS

有些话、适合烂在心里 提交于 2020-07-22 05:29:26
问题 I am trying to implement Stacked Horizontal Floating Bars using ChartJS but there is an unusual behaviour that I am facing. Can someone please help why is this happening. The code that I am using is : <html> <head> <title>Floating Bars</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script> <style> canvas { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } </style> </head> <body> <div> <canvas id="canvas" height="100"><

How to keep rounded bar corners when data is filtered chartJs?

筅森魡賤 提交于 2020-07-18 08:33:32
问题 I came up with this JSFiddle : https://www.jsfiddle.net/gcb1dyou which has rounded chartJs bar corners.Problem is when legend clicked to filter data,corners disappear like below When I clicked orange label as you can see rounded border disappeared on the yellow bar. var lastVisible = 0; for (var findLast = 0, findLastTo = this._chart.data.datasets.length; findLast < findLastTo; findLast++) { if (!this._chart.getDatasetMeta(findLast).hidden) { lastVisible = findLast; if (this._chart.data

chartjs: How to remove specific label

自作多情 提交于 2020-07-18 06:56:42
问题 I have a Bar Chart with these data and options: var data = { labels: periodnames, datasets: [ { yAxisID: "bar-stacked", data: rcash, backgroundColor: "#FFCE56", label:"" }, { yAxisID:"bar-stacked", data: pcash, backgroundColor: "#FFCE56", label: "cash" } ] }; var options = { animation: { animateScale: true }, scales: { xAxes: [{ stacked: true, }], yAxes: [ { display:false, id: "line-axis", }, { id: "bar-stacked", stacked: true, } ] } } finactivityGraphChart = new Chart(ctx, { type: 'bar',

ChartJS Only Show Large Font Size for a Specific Tick

泪湿孤枕 提交于 2020-07-16 08:25:22
问题 I am attempting to emphasize a specific value on the X-Axis if it meets a specific condition. For example, in my codepen I want to only change the font size of the 'blue' bar. Is this even possible with Chart.js? var ctx = document.getElementById("myChart").getContext('2d'); var myChart = new Chart(ctx, { type: 'bar', data: { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], backgroundColor: [ 'rgba(255, 99, 132, 0.2)

Chartjs 2 scaling lots of data points

余生颓废 提交于 2020-07-15 07:11:27
问题 I'm trying to render a line chart with 24 hours of data (collected every 30 seconds). I can't figure out from the docs how to get it to scale nicely. The docs say: When building its ticks, it will automatically calculate the most comfortable unit base on the size of the scale. But I can't get my line chart to scale "comfortably". I'm not sure it's what they mean, but I get far too many data points to render nicely. So I guess I'm looking for a way to drop data points (using chartjs, not hand

Chartjs 2 scaling lots of data points

百般思念 提交于 2020-07-15 07:11:22
问题 I'm trying to render a line chart with 24 hours of data (collected every 30 seconds). I can't figure out from the docs how to get it to scale nicely. The docs say: When building its ticks, it will automatically calculate the most comfortable unit base on the size of the scale. But I can't get my line chart to scale "comfortably". I'm not sure it's what they mean, but I get far too many data points to render nicely. So I guess I'm looking for a way to drop data points (using chartjs, not hand