English 中文(简体)
不能读懂未经界定的财产(阅读通知)。 - 图表。
原标题:Cannot read properties of undefined (reading notifyPlugins ) - chart.js

我的海图为什么试图在远离海图页时读一下(前线)?

https://i.stack.imgur.com/gjUwR.png”rel=“nofollow noreferer”>console mis

https://i.stack.imgur.com/2fQfJ.png”rel=“nofollow noreferer”>chartjs差(destroy function)

https://i.stack.imgur.com/ISPKo.png”rel=“nofollow noreferer”>ChartMetrics (line 454)

我曾尝试增加一个词。

afterRender: function (chart: ChartType) {
      chart.notifyPlugins( reset )
}

而后线则在我的原样中发挥作用,但这种工作是潜在的。 由于我看不见圣经,它似乎正在履行我的灾后职能。 退约。 这是我的gin:

 id: "chartTextPlugin",
    // Plugin for writing text in middle of chart
    beforeDraw: function (chart: ChartType) {
      const width = chart.width,
        height = chart.height,
        ctx = chart.ctx
      ctx.restore()

      // percentage text
      let fontSize = (height / 80).toFixed(2)
      ctx.font = fontSize + "em Aeonik"
      ctx.textBaseline = "middle"
      let text = value + "%",
        textX = Math.round((width - ctx.measureText(text).width) / 2)
      const textY = height / 2 + 5
      ctx.fillStyle = "#000000"
      ctx.fillText(text, textX, textY)
      ctx.save()

      // effective text
      fontSize = (height / 90).toFixed(2)
      ctx.font = fontSize + "em Aeonik"
      ctx.textBaseline = "middle"
      text = "Effective"
      const metrics = ctx.measureText(text)
      textX = Math.round((width - metrics.width) / 2)
      const EtextY = textY + 25
      ctx.fillStyle = "#797676"
      ctx.fillText(text, textX, EtextY)
      ctx.save()
    },
    afterDestroy: function (chart: ChartType) {
      chart.notifyPlugins( reset )
      console.log(chart)
    }

当我浏览一下我的网站上的另一页时,该图及其图象的负荷却绝对被罚款时,似乎会发生。 当Iavigate to another page I时,这一差错发生时,如果是重新上载新页(一个星号为星号),该差错不会再现。

问题回答

暂无回答




相关问题
Multiple line on x-axis in a linear chart did not show

I have a single axis line chart. The user would choose the year from a dropdown and the loan_type from another dropdown. The chart then should load the 12-months record of annual_payment and ...

Chart.js V4.3.0 X-Axis Labels Not Aligning

Using Chart.js v4.3.0, I m trying to left-align x-axis labels on a vertical bar chart. They are centered by default and my reading of the docs indicates that adding this to the chart s options would ...

How align bottom legend vertically Chart.js

How align bottom legend vertically Chart.js ? enter image description here https://www.chartjs.org/docs/latest/samples/other-charts/doughnut.html I need to align this code according to the image I ...

热门标签