Widget:JqPlotFromTable/doc

From WikiEducator
Jump to: navigation, search

This is the documentation for Widget:jqPlotFromTable


Sample Table

The html table (below) with id='dataTable1' has the following tag:

<table id="dataTable1">

and renders as

AccelerationForceMass
242
482
362
5102
10202

Parameters

  • tableID= must be set to the id of a table in the wiki page and the table must use html syntax not wiki markup.
  • xCol = integer for the x column in the data table (default:0 ie the left most column)
  • yCol = integer for the y column in the data table (default:1)
  • plotTitle = title at the top of the plot
  • width= width of the plot (integer)
  • height = height of plot (integer)
  • showLine = {true/false}
  • pointSize = integer that defines the size of the points {default:8}
  • pointStyle = {square, diamond, circle, etc}

Usage

There must be an html table on the wiki page with an ID. Do not use rich text mode because it will convert the html to wiki markup and the widget will not work.

Adding

{{#widget:jqPlotFromTable|tableID=dataTable1}} <div id='chart1' style="height: 300px; width:500px;"> <img src="/skins/common/images/Ajax-loader.gif" alt="Loading..." /> </div>

to a page with a table that has the id='dataTable1' (see table above) will give the following

<img src="/skins/common/images/Ajax-loader.gif" alt="Loading..." />

It is usually easier to use the Template:jqPlotFromTable instead of this widget as it has the div for the chart built in.