#using a extern js lib with tauri

4 messages · Page 1 of 1 (latest)

rapid rune
#

Hey, I want to plot a chart in my tauri application, I don't know how to do it so I guess I have to use a js library. I found Chart.js but I can't figure out how to link it to my tauri project (html + css+ js).

sacred lodge
#

it's the same as a npm project without tauri.

If you already use a frontend bundler like vite or webpack you can just do npm install chart.js and then import it with import Chart from 'chart.js/auto'

If you don't use a bundler, and don't want one, i'd download the prebuilt file from here https://cdn.jsdelivr.net/npm/chart.js and include that directly in your project.

#

but the gist is that there's nothing tauri-specific going on here so google should give you helpful results quite easily

rapid rune
#

ok