Skip to content

Commit a84c367

Browse files
committed
Improvement - VueUiTableSparkline - Add config attributes to control chart dimensions
1 parent fa1f47d commit a84c367

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/components/vue-ui-table-sparkline.vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ defineExpose({
362362
border: FINAL_CONFIG.thead.outline,
363363
textAlign: FINAL_CONFIG.thead.textAlign,
364364
fontWeight: FINAL_CONFIG.thead.bold ? 'bold' : 'normal',
365-
minWidth: i === colNames.length - 1 ? '150px' : '48px',
365+
minWidth: i === colNames.length - 1 ? `${FINAL_CONFIG.sparkline.dimensions.width}px` : '48px',
366366
cursor: datasetWithOrders[0].values[i] !== undefined ? 'pointer' : 'default',
367367
paddingRight: i === colNames.length - 1 && FINAL_CONFIG.userOptions.show ? '36px' : '',
368368
}" @click="() => orderDatasetByIndex(i)" :class="{'sticky-col': i === colNames.length - 1 && FINAL_CONFIG.showSparklines}"
@@ -533,13 +533,18 @@ defineExpose({
533533
fontWeight: FINAL_CONFIG.tbody.bold ? 'bold' : 'normal',
534534
textAlign: FINAL_CONFIG.tbody.textAlign,
535535
backgroundColor: FINAL_CONFIG.tbody.backgroundColor,
536-
padding: '0'
536+
padding: '0',
537537
}" class="vue-ui-data-table__tbody__td sticky-col">
538-
<SparkLine :key="`sparkline_${i}_${sparkStep}`" @hoverIndex="({ index }) => hoverSparkline({ dataIndex: index, serieIndex: i })
539-
" :dataset="tr.sparklineDataset" :showInfo="false" :selectedIndex="selectedDataIndex" :config="{
538+
<SparkLine
539+
:key="`sparkline_${i}_${sparkStep}`"
540+
@hoverIndex="({ index }) => hoverSparkline({ dataIndex: index, serieIndex: i })
541+
"
542+
:height-ratio="FINAL_CONFIG.sparkline.dimensions.heightRatio"
543+
:forced-padding="30"
544+
:dataset="tr.sparklineDataset" :showInfo="false" :selectedIndex="selectedDataIndex" :config="{
540545
type: FINAL_CONFIG.sparkline.type,
541546
style: {
542-
backgroundColor: FINAL_CONFIG.tbody.backgroundColor,
547+
backgroundColor: 'transparent',
543548
animation: {
544549
show: FINAL_CONFIG.sparkline.animation.show && !isPrinting && !isImaging,
545550
animationFrames: FINAL_CONFIG.sparkline.animation.animationFrames

0 commit comments

Comments
 (0)