Skip to content

Commit a93566e

Browse files
committed
Improvement - VueUiXy - Add formatters for tooltip time label
1 parent 68f09d6 commit a93566e

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/components/vue-ui-xy.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@ const tooltipContent = computed(() => {
20982098
} else {
20992099
if (time && time.text && FINAL_CONFIG.value.chart.tooltip.showTimeLabel) {
21002100
const precise = preciseTimeFormatter.value(selectedSerieIndex.value + slicer.value.start, FINAL_CONFIG.value.chart.tooltip.timeFormat);
2101-
html += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${FINAL_CONFIG.value.chart.tooltip.borderColor}; width:100%">${FINAL_CONFIG.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable ? precise : time.text}</div>`;
2101+
html += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${FINAL_CONFIG.value.chart.tooltip.borderColor}; width:100%">${FINAL_CONFIG.value.chart.grid.labels.xAxisLabels.datetimeFormatter.enable && !FINAL_CONFIG.value.chart.tooltip.useDefaultTimeFormat ? precise : time.text}</div>`;
21022102
}
21032103
selectedSeries.value.forEach(s => {
21042104
if (isSafeValue(s.value)) {

src/useConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ export function useConfig() {
641641
showPercentage: true,
642642
roundingValue: 0,
643643
roundingPercentage: 0,
644+
useDefaultTimeFormat: true,
644645
timeFormat: 'yyyy-MM-dd HH:mm:ss', // When datetimeFormatter is used
645646
},
646647
userOptions: USER_OPTIONS({

types/vue-data-ui.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3437,6 +3437,7 @@ declare module "vue-data-ui" {
34373437
>
34383438
) => string);
34393439
showTimeLabel?: boolean;
3440+
useDefaultTimeFormat?: boolean;
34403441
timeFormat?: string;
34413442
};
34423443
userOptions?: ChartUserOptions;

0 commit comments

Comments
 (0)