Chart.js trying to figure out where the .js file is that instructions refer to

Started by DaveLembke, July 27, 2024, 01:10:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DaveLembke

So I have a project where it references to Chart.js library for graphing. Instructions are as follow:

QuoteIn the downloaded Chart.js zip file, the .js files are located in the dist folder. Here are the steps to locate and use the required file:

    Extract the Zip File:

    Extract the contents of the downloaded zip file.

    Locate the .js File:

    Navigate to the dist folder inside the extracted files. You should find the following files:
        chart.js
        chart.min.js

    The chart.min.js file is the minified version that you should use for your project.

    Copy the .js File:

    Copy the chart.min.js file to your project's js or libs folder.

    Update Your HTML File:

    Modify your HTML file to reference the local chart.min.js file.

When going to the location that it refers to and downloading the file from github nowhere in that is a  dist folder with the chart.js or chart.min.js

I even used agent ransack to look over all contents of the github download to look for these files elsewhere and none to be found.

Anyone work with this before or able to figure out how I am off the beaten path with this one?

Here is the github link to see for yourself: https://github.com/chartjs/Chart.js/releases

Currently using this path here: https://cdn.jsdelivr.net/npm/chart.js that makes everything work, but I want it to be able to work offline as well and so I really need a local copy of that chart.js library to be able to do so to make the graph work correctly.

When running into issues and not finding a solution on Google I decided to give ChatGPT a try and thats where the instructions came from above which are wrong. Additionally ChatGPT mentions an older version which is Chart.js v3.7.0

DaveLembke

ok... so found some info digging... Its no longer pre-built and requires you to build it now. The instructions on how to build look straight forward and already have node.js installed and just need to install pnpm and build it.

More info here on it if anyone runs into this issue the same way that I did with out of date info from ChatGPT with use of chart.js.

https://www.chartjs.org/docs/latest/developers/contributing.html#building-and-testing