小编bbr*_*brg的帖子

ECharts / JS - 在工具提示中将时间整数格式化为 H:M:S

我正在尝试将工具提示和 Echarts 的 YAxis 的时间整数(例如 010511)更改为 01:05:11 的人类可读格式。

请注意,这不是时间戳,而是秒表类型的数据,始终从 00:00:00 开始并上升。

以下是 EChart 的当前状态。

<!-- Echart JS CC --> 
<script>

var chart = document.getElementById('cc_chart');
var myChart = echarts.init(chart);

var option = {
    title: { text: '' },
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'cross',
            label: {
                backgroundColor: '#6a7985'
            }
        }

    },
    textStyle: {
        color: '#fff'
    },
    grid: {
        left: '0',
        right: '4%',
        bottom: '27%',
        top: '4%',
        containLabel: true
    },
    dataZoom: [
        {
            type: 'inside',
            start: 0,
            end: 100
        }, …
Run Code Online (Sandbox Code Playgroud)

javascript formatting echarts

3
推荐指数
1
解决办法
4760
查看次数

标签 统计

echarts ×1

formatting ×1

javascript ×1