Commit 444b2467 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加 strokeWidth 线条宽度属性

parent 600d7b44
......@@ -20,6 +20,10 @@ export interface GaugeProps {
formatter?: (value: string) => string;
// 格式化内容
formatContent?: (value: number) => string;
/**
* 线条宽度
*/
strokeWidth?: number,
}
const defaultFormatter = (val: string): string => {
......@@ -85,6 +89,7 @@ const Gauge: React.FC<GaugeProps> = (props) => {
formatContent = defaultFormatContent,
color = '#2F9CFF',
bgColor = '#F0F2F5',
strokeWidth = 10,
} = props;
const cols = {
value: {
......@@ -128,12 +133,10 @@ const Gauge: React.FC<GaugeProps> = (props) => {
label={{
offset: -24,
formatter,
textStyle,
style: textStyle,
}}
subTickLine={null}
tickLine={{
length: -12,
}}
tickLine={null}
grid={null}
/>
<Point
......@@ -148,7 +151,7 @@ const Gauge: React.FC<GaugeProps> = (props) => {
end={[10, 0.965]}
style={{
stroke: bgColor,
lineWidth: 10,
lineWidth: strokeWidth,
lineDash: null,
}}
/>
......@@ -157,7 +160,7 @@ const Gauge: React.FC<GaugeProps> = (props) => {
end={[data[0].value, 0.965]}
style={{
stroke: color,
lineWidth: 10,
lineWidth: strokeWidth,
lineDash: null,
}}
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment