简体   繁体   English

用于比赛的 AngularJS 图表

[英]AngularJS Chart for Races

I have my file JSON like this and with this time format, there are time of laps:我有这样的文件 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"}]

With angularjs, I don't know what kind of chart use, and which dependecies use for this, can you give me some advices please.对于angularjs,我不知道使用什么样的图表,以及为此使用哪些依赖关系,请您给我一些建议。 I can use my json like this or I have to trasform in seconds?我可以像这样使用我的 json 还是我必须在几秒钟内转换? if I must trasform in what?如果我必须转换成什么? just seconds?就几秒钟?

with this function I solved my problems:有了这个功能,我解决了我的问题:

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);
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM