|
@@ -1,5 +1,5 @@
|
|
|
import { onMount } from "solid-js";
|
|
|
-import { Chart,registerShape } from '@antv/g2';
|
|
|
+import { Chart, registerShape } from '@antv/g2';
|
|
|
// import DataSet from '@antv/data-set';
|
|
|
|
|
|
import "../../../assets/style/CommonBigScreenHome.css"
|
|
@@ -26,9 +26,9 @@ registerShape('point', 'circular', {
|
|
|
const width = cfg.size;
|
|
|
return [
|
|
|
{ x: x - width / 2, y },
|
|
|
- { x, y: y + width*2 },
|
|
|
+ { x, y: y + width * 2 },
|
|
|
{ x: x + width / 2, y },
|
|
|
- { x, y: y - width*2 },
|
|
|
+ { x, y: y - width * 2 },
|
|
|
];
|
|
|
},
|
|
|
// 2. 绘制
|
|
@@ -111,6 +111,18 @@ function ListeningRate(prop) {
|
|
|
},
|
|
|
offsetX: 30,
|
|
|
});
|
|
|
+
|
|
|
+ chart
|
|
|
+ .annotation()
|
|
|
+ .text({
|
|
|
+ position: [item.type, item.value],
|
|
|
+ content: item.value + '%',
|
|
|
+ style: {
|
|
|
+ textAlign: 'center',
|
|
|
+ fill: '#fff',
|
|
|
+ },
|
|
|
+ offsetX: -30,
|
|
|
+ });
|
|
|
});
|
|
|
index = 0;
|
|
|
chart.point().position('type*value').shape('circular');
|
|
@@ -121,7 +133,7 @@ function ListeningRate(prop) {
|
|
|
})
|
|
|
return (
|
|
|
<div class="livRang" style={{
|
|
|
- height:`${prop.height}px`
|
|
|
+ height: `${prop.height}px`
|
|
|
}}>
|
|
|
<div class="head">{prop.title}</div>
|
|
|
<div ref={$canvas}></div>
|