Created
February 17, 2019 21:24
-
-
Save aeron7/8e92ea2a187745b3b7fa2628e255b83a to your computer and use it in GitHub Desktop.
Code for Dynamic Heatmap as described in Unofficed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f.write("<table><tbody><tr>") | |
i,j,k=0,0,0 | |
for x in range(i, endp): | |
symbol = positions['data'][x]['symbol'] | |
value = float(positions['data'][x]['per']) | |
if (i!=0 and i%13 == 0) : f.write("</tr><tr>") | |
if value >= 0 : f.write('<td style="background: '+str(positive_colors[j])+'; ">'+symbol+'<div class="per">'+str(value)+'%<div></td>') | |
j = j+1 | |
else : | |
f.write('<td style="background: '+str(negative_colors[k])+'; ">'+symbol+'<div class="per">'+str(value)+'%<div></td>') | |
k=k+1 | |
i=i+1 | |
f.write("</tr></tbody></table>") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment