Commit 212bf5df by Torkel Ödegaard

small fix to png rendering

parent 0fa6b34f
......@@ -62,7 +62,7 @@ function (angular, $, kbn, moment, _) {
if (!setElementHeight()) { return; }
if (_.isString(data)) {
render_panel_as_graphite_png();
render_panel_as_graphite_png(data);
return;
}
......@@ -166,28 +166,29 @@ function (angular, $, kbn, moment, _) {
addAxisLabels();
}
function render_panel_as_graphite_png() {
data += '&width=' + elem.width();
data += '&height=' + elem.css('height').replace('px', '');
data += '&bgcolor=1f1f1f'; // @grayDarker & @kibanaPanelBackground
data += '&fgcolor=BBBFC2'; // @textColor & @grayLighter
data += scope.panel.stack ? '&areaMode=stacked' : '';
data += scope.panel.fill !== 0 ? ('&areaAlpha=' + (scope.panel.fill/10).toFixed(1)) : '';
data += scope.panel.linewidth !== 0 ? '&lineWidth=' + scope.panel.linewidth : '';
data += scope.panel.steppedLine ? '&lineMode=staircase' : '';
function render_panel_as_graphite_png(url) {
url += '&width=' + elem.width();
url += '&height=' + elem.css('height').replace('px', '');
url += '&bgcolor=1f1f1f'; // @grayDarker & @kibanaPanelBackground
url += '&fgcolor=BBBFC2'; // @textColor & @grayLighter
url += scope.panel.stack ? '&areaMode=stacked' : '';
url += scope.panel.fill !== 0 ? ('&areaAlpha=' + (scope.panel.fill/10).toFixed(1)) : '';
url += scope.panel.linewidth !== 0 ? '&lineWidth=' + scope.panel.linewidth : '';
switch(scope.panel.nullPointMode) {
case 'connected':
data += '&lineMode=connected';
url += '&lineMode=connected';
break;
case 'null':
break; // graphite default lineMode
case 'null as zero':
data += "&drawNullAsZero=true";
url += "&drawNullAsZero=true";
break;
}
elem.html('<img src="' + data + '"></img>');
url += scope.panel.steppedLine ? '&lineMode=staircase' : '';
elem.html('<img src="' + url + '"></img>');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment