linechart.js
Library for drawing Line charts, using SVG.
Objects
Methods
Constants
- OAT.LineChartMarker.MARKER_CIRCLE
- OAT.LineChartMarker.MARKER_TRIANGLE
- OAT.LineChartMarker.MARKER_CROS
- OAT.LineChartMarker.MARKER_SQUARE
Creates a Line Chart inside div, optObj describes its properties. Its values:
- paddingLeft, paddingBottom, paddingTop, paddingRight
- axes - bool, should axes be drawn?
- legend - bool, should legend be drawn?
- markerSize - int
- colors - array of strings; one color per each dataset
- grid - bool, should we draw horizontal lines?
- gridDesc - bool; should we draw labels for horizontal lines?
- gridNum - int; approximate count of horizontal lines
- desc - bool; should we draw X labels
- markers - array of marker constants
- gridColor - string
- fontSize - int
Adds data to chart. dataArray may be an array of arrays; in this case, each sub-array is treated as one dataset.
Adds X axis labels.
Adds legend labels.
Draws the chart.
var data = [ [1,2,4,3], [4,3,2,1], [2,1,3,4], [3,4,1,2]];
var lc = new OAT.LineChart("myDiv",{markerSize:6});
lc.attachData(data);
lc.attachTextX(["a","b","c","d"]);
lc.attachTextY(["red","blue","green","yellow"]);
lc.draw();