Hello Everyone,
I installed bokeh but getting error “Error: property Grid.axis wasn’t declared”.
I have python version Python 3.6.12 and bokeh version 2.2.3.
Please guide me what can be the reason of this error?
Hello Everyone,
I installed bokeh but getting error “Error: property Grid.axis wasn’t declared”.
I have python version Python 3.6.12 and bokeh version 2.2.3.
Please guide me what can be the reason of this error?
HI @carolyn Thank you for ur time…
Here is my code…
def _compute_partograph(self):
for rec in self:
p = figure(plot_width=1100, plot_height=500)
p.xgrid.ticker = FixedTicker(num_minor_ticks=1, desired_num_ticks=12,
minor_ticks=[-2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5,
9.5, 10.5],
ticks=[-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
line = p.line([0, 7], [4, 22], line_width=2, line_color="#0000FF", legend="Alert", )
line2 = p.line([4, 11], [4, 22], line_width=2, line_color="#FF0000", legend="Action", )
p.xgrid.minor_grid_line_color = 'grey'
difff = []
pointss = []
crosses_x = []
dots_x = []
crosses_y = []
dots_y = []
lines_x = []
lines_y = []
dots_x.append(0)
lines_x.append([0, 0])
try:
dots_y.append(self.get_y_val_from_sta_press(rec.progress[0].st_o_pres))
lines_y.append(self.get_range_from_cx_len(rec.progress[0].cx_len.name))
crosses_y.append(int(rec.progress[0].cx_dil))
except Exception as e:
_logger.error(e)
# p.circle(x=0, y=, size=10)
crosses_x.append(0)
for count in range(len(rec.progress) - 1):
if rec.progress[count + 1].d_and_t:
diff = rec.progress[count + 1].d_and_t - rec.progress[0].d_and_t
point = (int(diff.seconds) // 60) / 60
pointss.append(point)
crosses_x.append(point)
crosses_y.append(int(rec.progress[count + 1].cx_dil))
dots_x.append(point)
dots_y.append(self.get_y_val_from_sta_press(rec.progress[count + 1].st_o_pres))
for length in rec.progress[count + 1].cx_len:
lines_x.append([point, point])
lines_y.append(self.get_range_from_cx_len(length.name))
p.cross(x=crosses_x, y=crosses_y, size=15, line_width=2, legend="Cx Dil")
p.circle(x=dots_x, y=dots_y, size=10, legend="Station of Pres")
for count in range(len(crosses_x) - 1):
p.segment(x0=crosses_x[count], y0=crosses_y[count], x1=crosses_x[count + 1], y1=crosses_y[count + 1],
color="lightgrey", line_width=3)
p.segment(x0=dots_x[count], y0=dots_y[count], x1=dots_x[count + 1], y1=dots_y[count + 1],
color="lightgrey", line_width=3)
try:
for count in range(len(lines_x)):
p.dash(x=lines_x[count], y=lines_y[count], line_width=3, size=15, legend="Cx len")
p.segment(x0=lines_x[count][0], y0=lines_y[count][0], x1=lines_x[count][1], y1=lines_y[count][1],
color="lightgrey", line_width=3)
except Exception as e:
_logger.error(e)
p.xaxis.axis_label = 'Time'
p.yaxis.axis_label = 'Dil'
p.toolbar.active_drag = None
for time_xaxis in difff:
p.cross(x=time_xaxis['point'], y=time_xaxis['dil'], size=20, line_width=2)
p.xgrid.grid_line_color = '#a3a8a3'
p.ygrid.grid_line_color = '#a3a8a3'
script, div = components(p)
rec.pgraph = '%s%s' % (div, script)
Hi @yaseenjamii that code is both too much (lots of clearly unrelated bits) and too little (not complete, can’t be run as-is). The best way to help us help you is to provide a Minimal Reproducible Example (and often the exercise of constructing an MRE can help you identify the problem yourself).