@@ -38,6 +38,7 @@ const step = ref(0);
3838const defaultConfig = ref (mainConfig .vue_ui_table_sparkline );
3939const isPrinting = ref (false );
4040const isImaging = ref (false );
41+ const sparkStep = ref (0 )
4142
4243const tableConfig = computed (() => {
4344 return useNestedProp ({
@@ -132,6 +133,10 @@ const datasetWithOrders = computed(() => {
132133
133134const mutableDataset = ref (datasetWithOrders .value )
134135
136+ const maxSeries = computed (() => {
137+ return Math .max (... mutableDataset .value .map (ds => (ds .values || []).length ))
138+ })
139+
135140const sortIndex = ref (undefined )
136141const isSorting = ref (false );
137142const currentSortingIndex = ref (undefined );
@@ -163,7 +168,8 @@ function orderDatasetByIndex(index) {
163168
164169 const sortedDataset = sortedIndices .map (i => datasetWithOrders .value [i]);
165170
166- mutableDataset .value = sortedDataset
171+ mutableDataset .value = sortedDataset;
172+ sparkStep .value += 1
167173}
168174
169175const maxSeriesLength = computed (() => {
@@ -373,7 +379,7 @@ defineExpose({
373379 < span> {{ tr .name ?? " -" }}< / span>
374380 < / div>
375381 < / td>
376- < td role= " cell" v- for = " (td , j) in tr.values " : style= " {
382+ < td role= " cell" v- for = " (_ , j) in maxSeries " : style= " {
377383 outline: tableConfig.tbody.outline,
378384 fontSize: `${tableConfig.tbody.fontSize}px`,
379385 fontWeight: tableConfig.tbody.bold ? 'bold' : 'normal',
@@ -393,7 +399,7 @@ defineExpose({
393399 ? '3px'
394400 : '',
395401 }" : data- cell= " colNames[j]" class = " vue-ui-data-table__tbody__td" @pointerenter= " selectedSerieIndex = i; selectedDataIndex = j" >
396- {{ Number (td .toFixed (tableConfig .roundingValues )).toLocaleString () }}
402+ {{ [ null , undefined ]. includes ( tr . values [j]) ? ' - ' : Number (tr . values [j] .toFixed (tableConfig .roundingValues )).toLocaleString () }}
397403 < / td>
398404 < td role= " cell" v- if = " tableConfig.showTotal" : style= " {
399405 outline: tableConfig.tbody.outline,
@@ -425,7 +431,7 @@ defineExpose({
425431 fontWeight: tableConfig.tbody.bold ? 'bold' : 'normal',
426432 textAlign: tableConfig.tbody.textAlign,
427433 }" class = " vue-ui-data-table__tbody__td sticky-col" >
428- < SparkLine @hoverIndex= " ({ index }) => hoverSparkline({ dataIndex: index, serieIndex: i })
434+ < SparkLine : key = " `sparkline_${i}_${sparkStep}` " @hoverIndex= " ({ index }) => hoverSparkline({ dataIndex: index, serieIndex: i })
429435 " : dataset= " tr.sparklineDataset" : showInfo= " false" : selectedIndex= " selectedDataIndex" : config= " {
430436 type: tableConfig.sparkline.type,
431437 style: {
0 commit comments