-
Is there any way of using Chartist v1 without using yarn or npm? My project uses v0.11 extensively but is built without package manager, as v0.11 worked fine when just including the .js/.css without additional dependencies. My Debian server has no yarn available and npm would introduce ~200 new packages, something I would like to avoid. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can use the UMD bundle of the Chartist lib and just copy the relevant one or two files to your project:
If you downloaded the NPM package, they are both located in node_modules/chartist/dist/ We do ship it this way in some projects where the typical distribution is something like a ZIP bundle and not a NPM package. If the build-process features a package manager, it's dynamically copied at build time. Otherwise just making a hard copy should be fine, too. Minimal working example: <html>
<head>
<title>Chartist Test</title>
<script src="node_modules/chartist/dist/index.umd.js"></script>
<link rel="stylesheet" href="node_modules/chartist/dist/index.css">
</head>
<body>
<div id="chart" style="height: 50vh"></div>
<script>
new Chartist.LineChart(
'#chart',
{
labels: [1, 2, 3, 4, 5, 6, 7, 8],
series: [[5, 9, 7, 8, 5, 3, 5, 4]]
},
{
low: 0,
showArea: true
}
);
</script>
</body>
</html> |
Beta Was this translation helpful? Give feedback.
-
Or you just download it, or directly include it in your website from one of the CDNs: https://cdn.jsdelivr.net/npm/chartist |
Beta Was this translation helpful? Give feedback.
You can use the UMD bundle of the Chartist lib and just copy the relevant one or two files to your project:
If you downloaded the NPM package, they are both located in node_modules/chartist/dist/
We do ship it this way in some projects where the typical distribution is something like a ZIP bundle and not a NPM package. If the build-process features a package manager, it's dynamically copied at build time. Otherwise just making a hard copy should be fine, too.
Minimal working example: