Commit 212bf5df by Torkel Ödegaard

small fix to png rendering

parent 0fa6b34f
...@@ -62,7 +62,7 @@ function (angular, $, kbn, moment, _) { ...@@ -62,7 +62,7 @@ function (angular, $, kbn, moment, _) {
if (!setElementHeight()) { return; } if (!setElementHeight()) { return; }
if (_.isString(data)) { if (_.isString(data)) {
render_panel_as_graphite_png(); render_panel_as_graphite_png(data);
return; return;
} }
...@@ -166,28 +166,29 @@ function (angular, $, kbn, moment, _) { ...@@ -166,28 +166,29 @@ function (angular, $, kbn, moment, _) {
addAxisLabels(); addAxisLabels();
} }
function render_panel_as_graphite_png() { function render_panel_as_graphite_png(url) {
data += '&width=' + elem.width(); url += '&width=' + elem.width();
data += '&height=' + elem.css('height').replace('px', ''); url += '&height=' + elem.css('height').replace('px', '');
data += '&bgcolor=1f1f1f'; // @grayDarker & @kibanaPanelBackground url += '&bgcolor=1f1f1f'; // @grayDarker & @kibanaPanelBackground
data += '&fgcolor=BBBFC2'; // @textColor & @grayLighter url += '&fgcolor=BBBFC2'; // @textColor & @grayLighter
data += scope.panel.stack ? '&areaMode=stacked' : ''; url += scope.panel.stack ? '&areaMode=stacked' : '';
data += scope.panel.fill !== 0 ? ('&areaAlpha=' + (scope.panel.fill/10).toFixed(1)) : ''; url += scope.panel.fill !== 0 ? ('&areaAlpha=' + (scope.panel.fill/10).toFixed(1)) : '';
data += scope.panel.linewidth !== 0 ? '&lineWidth=' + scope.panel.linewidth : ''; url += scope.panel.linewidth !== 0 ? '&lineWidth=' + scope.panel.linewidth : '';
data += scope.panel.steppedLine ? '&lineMode=staircase' : '';
switch(scope.panel.nullPointMode) { switch(scope.panel.nullPointMode) {
case 'connected': case 'connected':
data += '&lineMode=connected'; url += '&lineMode=connected';
break; break;
case 'null': case 'null':
break; // graphite default lineMode break; // graphite default lineMode
case 'null as zero': case 'null as zero':
data += "&drawNullAsZero=true"; url += "&drawNullAsZero=true";
break; 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