如何通过标签类型识别每个饼片?这个馅饼是等分的,但是我想要它,所以当我把鼠标悬停在一部分上时,它会显示那部分代表什么。即将鼠标悬停在知识片上,显示“知识类别”。你知道吗
knowledge_slice1 = (k_weighting1/100) * 360
thinking_slice1 = (t_weighting1/100) * 360
communication_slice1 = (c_weighting1/100) * 360
application_slice1 = (a_weighting1/100) * 360
course1_pie = Canvas(assessmentsframe1, width=255, height=255, bg = 'white')
course1_pie.create_arc((5, 5, 250, 250), fill = "#FFFFAA",
start= 0,
extent = knowledge_slice1)
course1_pie.create_arc((5, 5, 250, 250), fill = "#C0FEA4",
start= knowledge_slice1,
extent = thinking_slice1)
course1_pie.create_arc((5, 5, 250, 250), fill = "#AFAFFF",
start= knowledge_slice1 + thinking_slice1,
extent = communication_slice1)
course1_pie.create_arc((5, 5, 250, 250), fill = "#FFD490",
start= knowledge_slice1 + thinking_slice1 + communication_slice1,
extent =application_slice1)
我自己对python和Tkinter还不熟悉,但您可能希望使用<;Enter>;和<;Leave>;事件绑定。例如,这对我很有效:
相关问题 更多 >
编程相关推荐