散景随着时间的推移更改颜色

问题描述

因此,我尝试更改正方形的颜色,即不为null时的AssessmentReceived。 数据从数据库中出来,其中有空值。因此,当一个人提交评估时,我们要更改颜色,否则它将保持不变。

这是我的一部分代码 def build_progress_chart(df,课程代码):

### Set up Data
source = ColumnDataSource(df)
x='DayOfCourseX'
AssessmentReceived = 'ReceivedDay'

### Plot lines
p.line(x=x,y='CurrentY',color=colors[0],legend_label='Your Progress',line_width=3,line_alpha=.7,source=source)
p.line(x=x,y='BenchmarkY1',color=colors[3],line_dash='dashed',legend_label='Model of Success',y='BenchmarkY2',source=source)
p.varea(x=x,y1='BenchmarkY1',y2='BenchmarkY2',fill_alpha=.2,source=source)
#p.vbar(x=x,legend_label = 'Assessment Targets',width=1,bottom='AssessmentY1',top='AssessmentY2',fill_color=colors[1],fill_alpha=1,line_color='black',line_width=.5,source=source)
**if AssessmentReceived == None:
    p1 = p.square(x=x,y='AssessmentY',size=10,color="Yellow",source=source,hover_fill_color = colors[3],hover_fill_alpha = 1.0)
else:
    p1 = p.square(x=x,color="Black",hover_fill_alpha = 1.0)**

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)