Commits

Ralph Bean  committed 44421fd

Configurable height and width.

  • Participants
  • Parent commits 8d69421

Comments (0)

Files changed (1)

File tw2/jqplugins/jqplot/widgets.py

 
 
 class JQPlotWidget(tw2_jq_ui.JQueryUIWidget):
+    width = twc.Param("Width of the chart.", default="550px")
+    height = twc.Param("Height of the chart.", default="300px")
+    style = twc.Variable(attribute=True)
+
     resources = [
         tw2.jquery.jquery_js,
         tw2_jq_ui.jquery_ui_js, tw2_jq_ui.jquery_ui_css,
     def prepare(self):
         self._data = encoder.encode(self.data)
         self._options = encoder.encode(self.options)
+        self.style = "width:%s;height:%s;" % (self.width, self.height)
         super(JQPlotWidget, self).prepare()
 
 class PollingJQPlotWidget(JQPlotWidget):