mistercrunch commented on a change in pull request #3626: Set tooltip to show 
extent of sparkData
URL: 
https://github.com/apache/incubator-superset/pull/3626#discussion_r143626726
 
 

 ##########
 File path: superset/assets/visualizations/time_table.jsx
 ##########
 @@ -70,10 +70,10 @@ function viz(slice, payload) {
           // Period ratio sparkline
           sparkData = [];
           for (let i = c.timeRatio; i < data.length; i++) {
-            sparkData.push(data[i][metric] / data[i - c.timeRatio][metric]);
+            sparkData.push(d3.round(data[i][metric] / data[i - 
c.timeRatio][metric], 2));
           }
         }
-        const extent = d3.extent(data, d => d[metric]);
+        const extent = d3.extent(sparkData);
 
 Review comment:
   The line bellow is where we should do the appropriate formatting. The column 
form for the sparkline already has `d3format`, it's just a matter of using that 
configuration here. Right now it's unused but it was there originally for point 
labels which I then took out because they required large margins. If we ever 
bring back point labels we'd use the same formatting for both the tooltips and 
that. 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to