1

I am currently developing a dashboard using dashing.io and the dash itself is rendering fine. However, to plot the graphs I am using an additional widget which is based upon Chart.js. The problem comes when I need to update this graph with new data. The coffee-script of the widget is:

class Dashing.lin extends Dashing.Chartjs
  onData: (data) ->
    @barChart 'char', # The ID of your html element
      ["Hour 1", "Hour 2", "Hour 3", "Hour 4", "Hour 5"], # Horizontal     labels
      [
        label: 'Power Consumption' # Text displayed when hovered
        colorName: 'yellow' # Color of data
        data: [80, 59, 13, 31, 48] # Vertical points
      ]

My data is processed using python and I get that python script itself to modify the content of this file directly and update the data points in this script. The problem comes when in spite of the values getting updated, the graph doesn't reflect the changes. I am aware the Chart.js has a method update() but I am unable to successfully call that method from inside this coffee-script.

Thanks in advance

Neo979
  • 11
  • 2

0 Answers0