chart.js

'scales' option appears to break Chart.js graph

独自空忆成欢 提交于 2020-12-12 05:42:49
问题 I'm trying to include a line chart for some stock data in my django project using Chart.js. I can render a simple chart with the data I want just fine, but when I try to format the x-axis for date and time, the chart doesn't render anymore. Here's the working version of the file (client_small_market_view.html): {% load static %} <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js"></script> <div id="container" class="chartjs-wrapper"> <canvas id="stock-chart" class=

'scales' option appears to break Chart.js graph

淺唱寂寞╮ 提交于 2020-12-12 05:42:31
问题 I'm trying to include a line chart for some stock data in my django project using Chart.js. I can render a simple chart with the data I want just fine, but when I try to format the x-axis for date and time, the chart doesn't render anymore. Here's the working version of the file (client_small_market_view.html): {% load static %} <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js"></script> <div id="container" class="chartjs-wrapper"> <canvas id="stock-chart" class=

'scales' option appears to break Chart.js graph

给你一囗甜甜゛ 提交于 2020-12-12 05:41:41
问题 I'm trying to include a line chart for some stock data in my django project using Chart.js. I can render a simple chart with the data I want just fine, but when I try to format the x-axis for date and time, the chart doesn't render anymore. Here's the working version of the file (client_small_market_view.html): {% load static %} <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js"></script> <div id="container" class="chartjs-wrapper"> <canvas id="stock-chart" class=

Draw two plots using chartjs over one another with transparency

有些话、适合烂在心里 提交于 2020-12-09 04:42:59
问题 In Chartjs I have two plots, as shown here: var config = { type: 'line', data: { labels: [ "2017-07-03T01:05:00+0100", .... ], datasets: [ { label: "Consumption", fill: 'origin', pointRadius: 0, borderColor: "#0000ff", backgroundColor: "rgba(255,10,13,255)", data: [ 0.015625, 0.0199861111111, ... ], } , { fill: 'origin', label: "PV", pointRadius: 0, borderColor: "#ebf909", backgroundColor: "rgba(29,241,13,210)", data: [ 0.0, ..... ], } ] }, options: { responsive: true, title:{ display:true,

Draw two plots using chartjs over one another with transparency

ぐ巨炮叔叔 提交于 2020-12-09 04:40:07
问题 In Chartjs I have two plots, as shown here: var config = { type: 'line', data: { labels: [ "2017-07-03T01:05:00+0100", .... ], datasets: [ { label: "Consumption", fill: 'origin', pointRadius: 0, borderColor: "#0000ff", backgroundColor: "rgba(255,10,13,255)", data: [ 0.015625, 0.0199861111111, ... ], } , { fill: 'origin', label: "PV", pointRadius: 0, borderColor: "#ebf909", backgroundColor: "rgba(29,241,13,210)", data: [ 0.0, ..... ], } ] }, options: { responsive: true, title:{ display:true,

Update charts in chartjs and angular

萝らか妹 提交于 2020-12-08 07:54:32
问题 I have the problem with update chart js in angular. I am using for it ngrx store. In selector subscriber (run in ngOnInit) I tried update the chart data: this.yrSubscription = this.userDataStore.pipe(select(selectYrReport)) .subscribe(el => { el.sessions.forEach(item => { this.datasetsSessions[0].data.push(+item); }); }); And my chart data: datasetsSessions: ChartDataSets[] = [{ label: 'Sessions', data: [], fill: false }]; Register charts: private _registerCustomChartJSPlugin(): void {

Update charts in chartjs and angular

限于喜欢 提交于 2020-12-08 07:52:53
问题 I have the problem with update chart js in angular. I am using for it ngrx store. In selector subscriber (run in ngOnInit) I tried update the chart data: this.yrSubscription = this.userDataStore.pipe(select(selectYrReport)) .subscribe(el => { el.sessions.forEach(item => { this.datasetsSessions[0].data.push(+item); }); }); And my chart data: datasetsSessions: ChartDataSets[] = [{ label: 'Sessions', data: [], fill: false }]; Register charts: private _registerCustomChartJSPlugin(): void {

Adding image on the top of bar in chartjs

泄露秘密 提交于 2020-12-06 04:36:26
问题 I was using a different chart on my site which was causing some issues so we migrated to chartjs. Everything works fine but I have one requirement which I cannot find in chartjs. In the site I am working on, the user gives an assessment and it shows the graph based on the assessment results. So in the assessment, there is a question "Are you feeling exacerbation?" If the user selects yes then in the graph it shows an image above that bar like below image. In the picture you can see "E" above

Adding image on the top of bar in chartjs

匆匆过客 提交于 2020-12-06 04:35:18
问题 I was using a different chart on my site which was causing some issues so we migrated to chartjs. Everything works fine but I have one requirement which I cannot find in chartjs. In the site I am working on, the user gives an assessment and it shows the graph based on the assessment results. So in the assessment, there is a question "Are you feeling exacerbation?" If the user selects yes then in the graph it shows an image above that bar like below image. In the picture you can see "E" above