Skip to content

Commit 4c7d296

Browse files
committed
fix: add offset in pointed mode, change point styles in CChartLineSimple
1 parent 4663251 commit 4c7d296

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/views/charts/CChartLineSimple.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export default {
2222
type: String,
2323
default: 'transparent'
2424
},
25-
pointHoverBackgroundColor: String,
2625
dataPoints: {
2726
type: Array,
2827
default: () => [10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]
@@ -40,16 +39,25 @@ export default {
4039
data: this.dataPoints,
4140
borderColor: getColor(this.borderColor),
4241
backgroundColor: getColor(this.backgroundColor),
43-
pointHoverBackgroundColor: getColor(this.pointHoverBackgroundColor),
42+
pointBackgroundColor: this.pointBackgroundColor,
43+
pointHoverBackgroundColor: getColor(this.borderColor),
4444
label: this.label
4545
}
4646
]
4747
},
48+
pointBackgroundColor () {
49+
if (this.backgroundColor === 'transparent') {
50+
return '#fff'
51+
} else {
52+
return getColor(this.backgroundColor)
53+
}
54+
},
4855
pointedOptions () {
4956
return {
5057
scales: {
5158
xAxes: [
5259
{
60+
offset: true,
5361
gridLines: {
5462
color: 'transparent',
5563
zeroLineColor: 'transparent'

0 commit comments

Comments
 (0)