LineChart.prototype.add = function (set, xval, yval) {
if (this.sets[set] == null) {
this.legend.push(set);
}
...
}
LineChart.prototype.renderLegend = function (container) {
var colorScheme = this.options.colorScheme;
var rows = [];
for (var i = 0; i < this.legend.length; i++) {
var name = this.legend[i];
var color = colorScheme[i % colorScheme.length];
var style = { float: "left", marginRight: "2px", width: "8px",
height: "8px", border: "1px solid white", background: color };
var span = MochiKit.DOM.DIV({ style: style });
rows.push(MochiKit.DOM.DIV({}, span, name));
}
MochiKit.DOM.replaceChildNodes(container, rows);
}
Cheers,
/Per
> --
> You received this message because you are subscribed to the Google Groups "plotkit" group.
> To post to this group, send email to plo...@googlegroups.com.
> To unsubscribe from this group, send email to plotkit+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/plotkit?hl=en.
>
>