github graphieros/vue-data-ui v3.0.10

latest releases: v3.0.19, v3.0.18, v3.0.17...
3 days ago

VueUiXy

Add config options to customize time labels in:

  • tooltip
  • time tag
  • zoom labels

Especially useful when datetimeFormatter is enabled, to show a precise date inside these labels, which would otherwise have the same format as the time labels on the x axis.

This is a non-breaking change.

tooltip

const config = ref({
  chart: {
    tooltip: {
      useDefaultTimeFormat: true, // default, same behavior as before
      timeFormat: 'yyyy-MM-dd HH:mm:ss' // when datetimeFormatter is enabled and useDefaultTimeFormat is false
    }
  }
})

time tag

const config = ref({
  chart: {
    timeTag: {
      show: true, // false by default
      useDefaultFormat: true, // default, same behavior as before
      timeFormat: 'yyyy-MM-dd HH:mm:ss' // when datetimeFormatter is enabled and useDefaulFormat is false
      // customFormat works exactly as for the tooltip. null by default, pass a callback which returns a string to enable. Will override timeFormat
      customFormat: ({ absoluteIndex }) => {
        return String(absoluteIndex);
      }
    }
  }
})

zoom labels

const config = ref({
  chart: {
    zoom: {
      useDefaultFormat: true, // default, same behavior as before
      timeFormat: 'yyyy-MM-dd HH:mm:ss' // when datetimeFormatter is enabled and useDefaulFormat is false
      // customFormat works exactly as for the tooltip. null by default, pass a callback which returns a string to enable. Will override timeFormat
      customFormat: ({ absoluteIndex }) => {
        return String(absoluteIndex);
      }
    }
  }
})

Documentation website is up to date


If you just realized this is version 3 now, here are all the details.

Don't miss a new vue-data-ui release

NewReleases is sending notifications on new releases.