AngularJS比赛图表

时间:2015-07-01 14:03:12

标签: javascript json angularjs html5 charts

我有这样的文件JSON,并且使用这种时间格式,有时间圈:

[{"time":"00:05:52.92"},{"time":"00:06:22.26"},{"time":"00:06:22.26"},{"time":"00:02:22.26"},{"time":"00:07:22.26"},{"time":"00:06:22.26"},{"time":"00:00:22.26"},{"time":"00:01:22.26"},{"time":"00:04:22.26"}]

对于angularjs,我不知道使用什么类型的图表,以及哪些家属用于此,请您给我一些建议。我可以像这样使用我的json,或者我必须在几秒钟内完成转换?如果我必须改变什么?几秒钟?

1 个答案:

答案 0 :(得分:0)

使用此功能我解决了我的问题:

function (secs){   
    var divisor_for_minutes = secs.value % (60 * 60);
    var minutes = Math.floor(divisor_for_minutes / 60);
    var divisor_for_seconds = divisor_for_minutes % 60;
    var seconds = Math.ceil(divisor_for_seconds);
    return minutes + ":" + divisor_for_seconds.toFixed(2);
    }