After coming across this helpful post on Stack Overflow, I decided to implement the threshold plugin mentioned here. However, when trying to do so, I ran into the error message "Chartist is not defined."
I'm a bit stuck because I'm not quite sure how to replicate a constructor in Vue/Nuxt. This could be the reason for the error, or perhaps the approach outlined in the post isn't suitable for my specific needs.
Below is the code snippet that I've been working with:
<template>
<div class="ct-chart"></div>
</template>
<script>
import Chartist from 'chartist'
import * as Threshold from 'chartist-plugin-threshold'
...
export default {
mounted() {
var threshold = Threshold()
new Chartist.Line(
'.ct-chart',
...
plugins: [
Chartist.plugins.ctThreshold({
threshold: 4,
}),
],