TW2 widget wrapper the jquery ui jqplot

Get the source from

  • location
    • Location on the page where the resource should be placed.This can be one of: head, headbottom, bodytop or bodybottom. None means the resource will not be injected, which is still useful, e.g. static images.
  • modname
    • Name of Python module that contains the file.
  • filename
    • Path to file, relative to module base.
  • no_inject
    • Don't inject this link. (Default: False)
  • whole_dir
    • Make the whole directory available. (Default: False)

sin plot
  • options
    • Plot options
  • events
    • (dict) (BETA) javascript callbacks for events
  • data
    • An array of data series
  • height
    • The height of the graph
  • width
    • The width of the graph
  • label
    • Label for the graph
class DemoFlot(FlotWidget):
    data = [
            'data': [[f(i), math.sin(f(i))] for i in range(20)],
            'label': "sin(x)"
    label = "sin plot"
<%namespace name="tw" module="tw2.core.mako_util"/>
<div id="${w.attrs['id']}"
  <div id="flotLabel">${w.label}</div>
  <script type="text/javascript">
	% if
    $.plot($("#${w.selector|n}"), ${w._data|n}, ${w._options|n});
	% endif