Plot uses ColorPalette to allocate colors

This commit is contained in:
Pete Richards 2015-08-12 16:27:28 -07:00
parent 52b8720d37
commit cb41be7922
3 changed files with 6 additions and 4 deletions

View File

@ -4,7 +4,7 @@
<span class="plot-legend-item"
ng-repeat="series in series">
<span class="plot-color-swatch"
ng-style="{ 'background-color': series.color }">
ng-style="{ 'background-color': series.color.asHexString() }">
</span>
<span class="title-label">{{ series.name }}</span>
</span>

View File

@ -1,7 +1,8 @@
/*global define*/
define(
function () {
['../ColorPalette.js'],
function (ColorPalette) {
"use strict";
// TODO: Store this in more accessible locations / retrieve from
@ -13,6 +14,7 @@ define(
var isLive = true;
var maxDomain = +new Date();
var subscriptions = [];
var palette = new ColorPalette();
var setToDefaultViewport = function() {
// TODO: We shouldn't set the viewport until we have received data or something has given us a reasonable viewport.
$scope.viewport = {
@ -63,7 +65,7 @@ define(
var series = {
name: model.name,
// TODO: Bring back PlotPalette.
color: [0.12549019607843137, 0.6980392156862745, 0.6666666666666666, 1],
color: palette.getColor(),
data: []
};

View File

@ -107,7 +107,7 @@ define(
lines.forEach(function(line) {
drawAPI.drawLine(
line.buffer,
line.color,
line.color.asRGBAArray(),
line.pointCount
);
});