纯css实现的扇形图表效果代码
代码语言:html
所属分类:图表
代码描述:纯css实现的扇形图表效果代码,鼠标悬浮显示数值
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> .graph { --firstValue: 10; --secondValue: 30; --firstColor: #f13c59; --secondColor: #6441b5; --thirdColor: #d379e3; position: relative; display: inline-block; width: 30vw; height: 30vw; margin: 8px; --calcSecValue: calc(var(--firstValue) + var(--secondValue)); background-image: conic-gradient( var(--firstColor) calc(var(--firstValue) * 3.6deg), var(--secondColor) calc(var(--firstValue) * 3.6deg), var(--secondColor) calc(var(--calcSecValue) * 3.6deg), var(--thirdColor) calc(var(--calcSecValue) * 3.6deg) ); aspect-ratio: 1; border-radius: 50%; /* clip-path: circle(50% at 50% 50%); */ } .graph:hover div::after, .graph:hover div::before, .graph:hover::before { trans.........完整代码请登录后点击上方下载按钮下载查看
网友评论0