All Questions
180
questions
0
votes
1
answer
178
views
How do I create charts on my javascript website using data from mySQL database. Using EJS front-end
I am making a website where I can enter data for golf course greens, and then analyze it.
I am using express in my backend to route to my ejs pages. I am also using a mySQL database to store the data.
...
0
votes
0
answers
27
views
Data lables not working proper in node + ts
I have used chart js to generate chart image in node + ts and generate bar chart for that bar chart i want data labels at the end of the chart but that is not working properly i have used below config ...
0
votes
0
answers
164
views
Chartjs afterDraw not showing the line
I am trying to make a chartjs bar chart using dates.
Those are the options i am using to set my chart as i want but i want to add a line at the current date. Here's how i approached it:
public ...
1
vote
1
answer
45
views
To configure Chart.js to display hours on the x-axis ticks when rendering charts in a Node.js
i am generating chart image in node using chart js how can i use hours on the ticks is there any idea for that
Error: This method is not implemented: Check that a complete date adapter is provided.
...
0
votes
1
answer
325
views
How to create a bar chart image on nodejs without a browser?
Have a single nodejs project using a PDF generator, and need paste a bar chart into it, but the project runs on a desktopless server.
Have any library or method to create a bar chart image on nodejs ...
0
votes
2
answers
164
views
Unable to access Chart.Js library from npm package install
For context I am building a web application that logs hours spent on certain skills or activities and then displays this data back to the user via a bar graph using Chart.js. I am able to successfully ...
0
votes
1
answer
97
views
How to display an object from server side to client side as a chart using express+ejs+chartjs?
I am trying to pass two objects weights(list with integer value) and progressDatas(list with string value) from the server side to the client side. In the client side I am stuck at how to render the ...
1
vote
0
answers
50
views
Chart.js Pie Chart: How to Make Data Labels Stay Fixed Relative to Segments?
I'm using Chart.js to create a pie chart with data labels. However, I'm encountering an issue where the data labels rotate freely instead of staying fixed relative to their respective segments when ...
0
votes
0
answers
117
views
How to Insert/add the chart in excel using JS?
I have added the below snippet to add the table and chart axis in excel. While clicking the Export to Excel button , no excel is downloaded in the browser. I need to draw a chart with the table data. ...
1
vote
1
answer
529
views
How to create a chart in pdf and excel using node js?
JavaScript function to create the line chart:
function TyLyReport() {
var lineChartData = {
labels : ["Jan","Feb","Mar"],
...
0
votes
0
answers
39
views
Chartjs v3 no title text gets displayed
I am using chartjs-node-canvas together with chart.js v3.9.1 to generate a chart. At first, my chart had a title text displayed but after I was done modifying the options the title will not be ...
1
vote
1
answer
379
views
How to set the background color of chart js in node js
Cant able to set background color for the chart js
Im creating an application where i will share chart to slack, im creating the chart in backend using node canvas and chart js , im generating the ...
1
vote
0
answers
54
views
Position y tick lines at both sides of the border
I try to make a chart using chart.js. It should look like following (tick line at both side of border): .
All I achieved so far:
How can I draw tick line at both sides of a border? Or there is other ...
0
votes
1
answer
109
views
How to use task module in teams to show interactive charts?
I am building a teams bot using a Botframework SDK 4.0 , which shows interactive charts when a user requests it in the chat. Currently i can only generate a chart using Chart.js and convert it to an ...
1
vote
0
answers
62
views
Output percentage in chart js label in a donut chart
Im using chart js in my portfolio dashboard to track my visitors. This specific chart is tracking visits per page. Im doing this with express and mongodb. Everything works except i cant see the actual ...
0
votes
1
answer
68
views
is there a way to pass rendered variables from pug templates to client side JS files?
I am making a small project with Node.js, Express and Pug templates. I am passing data with res.render('template', {processedData}); to pug template where I have two graphs created with Chart.js. I ...
1
vote
1
answer
1k
views
How to Correctly import JS modules - (Nodejs - Express)
I am currently learning to use nodejs with express as my franework and handlebar as the template engine.
PS: This is from the chartjs tutorial where they use parcel.
When I am trying to do the same ...
-1
votes
1
answer
214
views
MongoDB Data Fetch and Insert ChartJs
I have a document model in MongoDB
{ _id:
author:
title:
content:
}
Collection name: posts
How can I group distinctly author names and count how many documents exist in my collection related to ...
0
votes
0
answers
249
views
Chartjs-node-canvas heap out of memory
I am running this code in a NodeJS Server. The idea is to create charts to insert in PDF with PDFMake.
Stress Testing it, reaches Heap Out of Memory.
So, I wonder if there is a way of configuring the ...
1
vote
0
answers
49
views
Automating Refresh of Graphs using Node.js
I am creating an analytics of my Facebook bot, it contains the frequency of the commands that is being used and the RAM status of the server, both displayed as graph on the server-side web, I am using ...
2
votes
1
answer
1k
views
Chart.js chartjs-node-canvas this._chartJs is not a constructor
I am trying to create Chart using Chart.js on backend I have followed chartjs-node-canvas
but getting TypeError: this._chartJs is not a constructor
My Chart.js version is 4.2.0 and chartjs-node-canvas ...
1
vote
1
answer
606
views
How do I create a chart and write it to a png file?
Hello I'm trying to use chart.js to create charts however I have found it hard to find out how to create graphs in my node js program, it requires a context but as it's local I'm not sure what to put ...
1
vote
0
answers
268
views
Error when trying to import react-chartjs-2
I am currently developing a software with Electron and for the graphic part, I wish to be able to display curves in real time with React and react-chartjs-2 except that when I imported the library for ...
1
vote
0
answers
76
views
Error while rendering buffer in chartjs-node-canvas
I am trying to render a line graph image using the renderToBuffer method in ChartJSNodeCanvas. It works fine locally, but when I have deployed I am getting the following error:
Can anyone help me in ...
1
vote
0
answers
117
views
ChartJS label font size is scaled up and squeezed together
I have a nodejs app which is generating chartjs diagram images. In local the label is fine it looks like this:
But when I deploy exactly the same code to azure it looks like the label is scaled up ...
0
votes
1
answer
244
views
How to display data in daily weekly monthly basis?
I am calling to an api and storing some data on postgresql database. The data I am storing looks like :
[
{
"uuid": "123",
"prompt_tokens":...
0
votes
1
answer
935
views
Unexpected token '{'. import call expects exactly one argument - when trying to import chart.js
I am creating a simple node.js app that uses chart.js for some visualisations but when trying to import and use Chart I am getting errors.
I used npm to install chart.js and served it to the client ...
1
vote
0
answers
792
views
Next.js build error No "exports" main defined with chart.js
I am currently moving from craco (react-scripts) to Next.js but I have a problem in the build step. If I run the app in development it works perfectly but when I try to build it I get an error on the &...
0
votes
1
answer
56
views
chart js bar chart is not getting displayed correctly
Below is my configuration which i am using in chart js , but the bar is not getting displayed correctly . This is a payload which i am sending from external application to node js server which then ...
0
votes
1
answer
551
views
Chartjs pie chart and Vuejs
I am using chart.js to create a pie chart, I added filters to the chart to change the scope. I set the overview filter to true so the user can load on screen and see the whole piechart overview. For ...
2
votes
1
answer
244
views
How to integrate mustache template to read json data and dynamically display it in Chartjs
I tried to pass data from data.json to mustache template in order to create bar graph.
I am unable to figure out where exactly I need to pass the data to get the graph right.
Please help me to figure ...
0
votes
1
answer
175
views
How to detect the insertion of a new data?
I would like to know if there is a way to detect each time there is a new data inserted in a data table so that I can update a chart in my application.
I use postgreSQL, node.js, vue.js for the ...
0
votes
2
answers
248
views
How to keep the styles of a graph when refreshing the page?
I need help because I am having a problem with my graph
I am using chartjs-node-canva which is a version of chartjs to use in nodejs as an easy way to use the library from the backend. What I am doing ...
0
votes
1
answer
100
views
Historical Grouping with Mongoose
I am developing a project with node js and I want to use a chart in the project.
I am using MongoDB and I want to group information from database historically.
For example, let's say there is a ...
3
votes
1
answer
1k
views
Grouping x-axis labels on multiple lines on a ChartJS with an extra dimension
Please help me
I have the following graph, where I have where each user belongs to a different area
I was wondering if there is a way to group the information by "user role" and once it is ...
0
votes
2
answers
3k
views
How to place text inside of doughnut chart using primeng/chart.js?
I'm working on a primeng chart and developing a doughnut chart along with angular. Now I need to show the text inside of the doughnut chart as per design . Like the image below
image link
My HTML :
&...
0
votes
0
answers
223
views
Remove space between bars if one category value is null or 0 in bar chartjs?
How to remove this space?
I tested with this jsfiddle
https://jsfiddle.net/cqnhe2fa/
also I modified data as
aDatasets1 = [65,59,80,-81,56,55,40];
aDatasets2 = [null,30,40,50,60,20,25];
aDatasets3 = ...
3
votes
3
answers
12k
views
Error: Cannot find module 'canvas' - Chart.js
I'm using chartjs-node-canvas with chartjs to render a graph config as an image, so after installing it I tried the following :
import { ChartJSNodeCanvas } from 'chartjs-node-canvas';
const ...
2
votes
2
answers
798
views
Chart.js (chartjs-node-canvas) create date-based floating bar graph
I will attempt to explain my issue as clearly as possible while also avoid making this topic too long. I recently found the Chart.js library, which is excellent for what I need. Now, since I am using ...
1
vote
1
answer
533
views
ChartJSNodeCanvas plugin chartjs-plugin-annotation creates error: HTMLCanvasElement is not defined
I want to create my chart as png on the server.
The X axe is based on time, therefore I need the date adapter.
const chartJSNodeCanvas = new ChartJSNodeCanvas({
width: 512,
height: 400,
...
1
vote
0
answers
279
views
Import data in chart.js (Node.js)
I have a problem with import data using chart.js. I am making aplications in node.js and i would like to import data from another file (use require).
When i import data then my chart not loading and ...
0
votes
3
answers
198
views
node js mysql query result rendered to chart.js labels in pug page
I've this strange behaviour when i make a get request. A query to mysql calls for totals of sells(float) group by days (nvarchar). I've made 2 arrays (for totals and datas) where i push the content of ...
0
votes
2
answers
76
views
Issue in implementing ChartJS in my new assignment of ReactJS App, please let me know where I am wrong
I want to upload a chart in my react app but when I use this Barchar.jsx component (have used js nothing changed) it is showing following errors in console(are in image.)
import React from "react&...
1
vote
0
answers
195
views
How to add data to Chart.js on ejs using for loop?
I have two datasets coming from Express called cDate, cPrice and they have data.length elements. I want to draw these datas on a chart.I tried many things but the graphic is not updating. My final ...
0
votes
1
answer
1k
views
Getting "Uncaught TypeError: Cannot read properties of undefined (reading 'map')" when using Chartjs inside react axios method
I was trying to create a chart using Chartjs in react. For that I used axios post method to get data from database from server that I created in Nodejs. When I used chartjs in axios I am getting this ...
-1
votes
1
answer
770
views
Pass objects from javascript to Chart.JS through EJS
I have an object (data) coming from a js file.
router.get('/participant-module',(req,res)=>{
let sql = dbModel.participant_per_module;
db.query(sql, (err, result)=>{
if(err) ...
1
vote
1
answer
4k
views
How to update Chartjs chart (react-chartjs-2) with dynamic data?
I've been trying to make a simple chart generator in React. I use Handsontable to let the user enter dynamic data and I would like the changes to be reflected in the chart. Here is my code: ...
0
votes
0
answers
640
views
Chartjs node-canvas renders low resolution image
I am rendering charts using chartjs-node-canvas for chart.js v3 on my backend. Everything works great, however produced images have low resolution. Below attaching 2 versions.
First picture is ...
5
votes
3
answers
643
views
Chart js showing squares
I am using the npm module chartjs-node-canvas to create the chart and add it to my xlsx file .
I am getting the wanted result without running my app as a dokcer container .
Here the result got after ...
1
vote
0
answers
243
views
How do we handle socket data emission when the user is changing input parameters? (Node.js, React.js, Postgres, Socket.io)
I have a React.js and Node.js application where I have a Chart.js component whose objective is to show real-time data coming from Postgres database. The chart has a multi-select dropdown from where ...