File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
packages/vuetify/src/components/VSparkline Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ export const VBarline = genericComponent<VBarlineSlots>()({
123
123
124
124
const bars = computed ( ( ) => genBars ( items . value , boundary . value ) )
125
125
const offsetX = computed ( ( ) => ( Math . abs ( bars . value [ 0 ] . x - bars . value [ 1 ] . x ) - lineWidth . value ) / 2 )
126
+ const smooth = computed ( ( ) => typeof props . smooth === 'boolean' ? ( props . smooth ? 2 : 0 ) : Number ( props . smooth ) )
126
127
127
128
useRender ( ( ) => {
128
129
const gradientData = ! props . gradient . slice ( ) . length ? [ '' ] : props . gradient . slice ( ) . reverse ( )
@@ -155,8 +156,8 @@ export const VBarline = genericComponent<VBarlineSlots>()({
155
156
y = { item . y }
156
157
width = { lineWidth . value }
157
158
height = { item . height }
158
- rx = { typeof props . smooth === 'number' ? props . smooth : props . smooth ? 2 : 0 }
159
- ry = { typeof props . smooth === 'number' ? props . smooth : props . smooth ? 2 : 0 }
159
+ rx = { smooth . value }
160
+ ry = { smooth . value }
160
161
>
161
162
{ props . autoDraw && (
162
163
< >
Original file line number Diff line number Diff line change @@ -149,9 +149,11 @@ export const VTrendline = genericComponent<VTrendlineSlots>()({
149
149
} , { immediate : true } )
150
150
151
151
function genPath ( fill : boolean ) {
152
+ const smoothValue = typeof props . smooth === 'boolean' ? ( props . smooth ? 8 : 0 ) : Number ( props . smooth )
153
+
152
154
return _genPath (
153
155
genPoints ( items . value , boundary . value ) ,
154
- props . smooth ? 8 : Number ( props . smooth ) ,
156
+ smoothValue ,
155
157
fill ,
156
158
parseInt ( props . height , 10 )
157
159
)
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { propsFactory } from '@/util'
4
4
// Types
5
5
import type { PropType } from 'vue'
6
6
7
- export type SparklineItem = number | { value : number }
7
+ export type SparklineItem = string | number | { value : number }
8
8
9
9
export const makeLineProps = propsFactory ( {
10
10
autoDraw : Boolean ,
@@ -55,7 +55,7 @@ export const makeLineProps = propsFactory({
55
55
default : 8 ,
56
56
} ,
57
57
showLabels : Boolean ,
58
- smooth : Boolean ,
58
+ smooth : [ Boolean , String , Number ] ,
59
59
width : {
60
60
type : [ Number , String ] ,
61
61
default : 300 ,
You can’t perform that action at this time.
0 commit comments