Commit 279077d5 authored by Sanjay Yadav's avatar Sanjay Yadav

FXD: Fixed buyild errors.

parent 44444a46
Pipeline #30975 failed with stage
in 12 seconds
......@@ -1235,34 +1235,39 @@ def heatgrid(shape, spec, data):
top = shape.top
left = shape.left
width = shape.width
height = spec.get('height', 200000)
pixel_inch = 10000
default_height = 20
fifteen_percent = 0.15
height = spec.get('height', default_height) * pixel_inch
parent = shape._parent
shape.element.delete()
data = data[spec['data']]
names = data[spec['group']].unique().tolist()
hours = sorted(data[spec['range']].unique().tolist())
twenty_percent = (width * 0.15)
twenty_percent = (width * fifteen_percent)
height_padding = 10
height_padding = height_padding * pixel_inch
for idx, hour in enumerate(hours):
txt = parent.add_textbox(
left + ((width - twenty_percent) / len(hours)) * idx + twenty_percent,
top - height - 100000, ((width - twenty_percent) / len(hours)), height)
top - height - height_padding, ((width - twenty_percent) / len(hours)), height)
font_size = 14
default_txt_color = '#000000'
add_text_to_shape(txt, '{}'.format(hour).zfill(2), font_size, default_txt_color)
width_padding = 5
width_padding = width_padding * pixel_inch
for index, name in enumerate(names):
d = data[data['name'] == name].reset_index()
w = (width - twenty_percent) / float(len(d))
for idx, row in d.iterrows():
_rect = rect(parent, left + (w * idx) + twenty_percent,
top + (height * index) + 100000 * index,
w - 50000, height)
top + (height * index) + height_padding * index,
w - width_padding, height)
rect_css(_rect, **{'fill': '#f0f000', 'stroke': '#cccccc'})
txt = parent.add_textbox(
left, top + (height * index) + 100000 * index,
left, top + (height * index) + height_padding * index,
w + twenty_percent, height)
font_size = 14
default_txt_color = '#000000'
......
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