Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: tracing/tracing/ui/base/chart_base.html

Issue 2341623002: Display Histograms in value-set-table-cells. (Closed)
Patch Set: . Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/ui/base/bar_chart.html ('k') | tracing/tracing/ui/base/chart_base_2d.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/ui/base/chart_base.html
diff --git a/tracing/tracing/ui/base/chart_base.html b/tracing/tracing/ui/base/chart_base.html
index ec2f63b2adc682d266dc00c763f5138d0152f801..1a5b943e480b69e18b17c0d9f1b0584ee7438529 100644
--- a/tracing/tracing/ui/base/chart_base.html
+++ b/tracing/tracing/ui/base/chart_base.html
@@ -34,6 +34,26 @@ found in the LICENSE file.
<script>
'use strict';
+
+tr.exportTo('tr.ui.b', function() {
+ function getSVGTextWidth(parentNode, text) {
+ var textNode = document.createElementNS(
+ 'http://www.w3.org/2000/svg', 'text');
+ textNode.setAttributeNS(null, 'x', 0);
+ textNode.setAttributeNS(null, 'y', 0);
+ textNode.setAttributeNS(null, 'fill', 'black');
+ textNode.appendChild(document.createTextNode(text));
+ parentNode.appendChild(textNode);
+ var widthPx = textNode.getComputedTextLength();
+ parentNode.removeChild(textNode);
+ return widthPx;
+ }
+
+ return {
+ getSVGTextWidth: getSVGTextWidth
+ };
+});
+
Polymer({
is: 'tr-ui-b-chart-legend-key',
« no previous file with comments | « tracing/tracing/ui/base/bar_chart.html ('k') | tracing/tracing/ui/base/chart_base_2d.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698