[Solved] How does one make Chart.js "inline" to facilatate a single file application for IoT/embedded systems ??? #11219
-
Hi friends. So... I'm working on an IoT embedded system. It has LIMITED web server capability. It certainly cannot run the typical, modern, JavaScript front-ends of today's Internet. . . and it doesn't need to. The application is a basic sensor (temp, for example) that needs to simply log some data, then cleanly line graph that upon request to the (web) user interface. I would love to use Chart.js for this functionality, as it's clean and small and does exactly what I need (Animation>Loop example is almost perfect). The problem I'm having is that Chart.js was designed for modern modular architectures, and the examples follow this. With other libraries, I simply open a URL to the minified ".js" file served from some CDN, copy/paste that into the folds of a <script> tag in an HTML doc, and boom! I can use the library.... as easy as pie! (For instance, CanvasJS can work this way.) However, I'm having trouble doing this with Chart.js. So, how do I get Chart.js as just a minified JavaScript file that I can then paste between an html script tag in a hypothetical single html file? Or, arguably the real issue, how do I use the examples after I have done such things? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Should be covered by documentation: https://www.chartjs.org/docs/latest/getting-started/integration.html#script-tag |
Beta Was this translation helpful? Give feedback.
-
I marked your answer as the answer proper, as it is the technically correct and true way to use the library in the way I asked. However, it does not actually solve my particular problem, and it has now become clear to me why I was having so much headaches. . . Put bluntly, the samples provided by the project are essentially useless as examples one can work from. This is because they are built using a funky system for documentation purposes, which employs an ad hoc utility application in addition to some non specific plugin that builds interface buttons. Basically, the samples look absolutely nothing like what an application in the wild would look like. . . I could go on with notions of disapproval to this decision, but then I would just be ranting, which isn't productive at all. I know what I need to know now, and that requires a new question, which implied a new post/thread. I consider this specific and particular question solved, and will now move onto other questions. TY for the help. |
Beta Was this translation helpful? Give feedback.
Should be covered by documentation: https://www.chartjs.org/docs/latest/getting-started/integration.html#script-tag