Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chartjs-node-canvas showing squares #113

Open
mjmaurya opened this issue Jul 17, 2022 · 2 comments
Open

chartjs-node-canvas showing squares #113

mjmaurya opened this issue Jul 17, 2022 · 2 comments

Comments

@mjmaurya
Copy link

Describe the bug
I am using the npm module chartjs-node-canvas to create the chart and add it to my email. I am getting the wanted result without running the javascript script as a docker container. Here is the result got after running my javascript script with docker :

Chart Image

Versions

  • NodeJS version: 16.19
  • Chart.JS version: 3.8

Additional context

Dockerfile

FROM ubuntu:latest
RUN mkdir -p /usr/src/app/script
WORKDIR /usr/src/app
COPY . /usr/src/app/script

RUN apt-get update && apt-get upgrade -y && apt-get -y install curl && curl -sL https://deb.nodesource.com/setup_16.x | bash - \
    && apt-get install -y nodejs
COPY package*.json ./
RUN npm install -g
RUN npm i chartjs-node-canvas chart.js
RUN apt-get update && apt-get -y install cron

RUN chmod +x script/src/DailyReports.js script/src/GenerateReport.js script/entrypoint.sh

ENTRYPOINT ["/usr/src/app/script/entrypoint.sh"]
@kaboume
Copy link

kaboume commented Nov 13, 2022

hi,
I have the same issue.
Did you find a solution ?
thanks.

@sinyo1015
Copy link

sinyo1015 commented Feb 6, 2023

You could add apt install fonts-freefont-ttf in your Dockerfile, although it will choose random font to display onto unless you specify it explicitly.
#105 (comment)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants