Why Doesn’t My Duration Chart Work?

Why Doesn’t My Duration Chart Work?

Use meta.duration, Not result.duration

If you’re trying to build a chart with duration as the metric and it’s not working, then the reason is probably that you’re trying to get values from result.duration. Use meta.duration instead.

Statements encode the result.duration property as a string in ISO 8601 format: e.g., PT59.14S = 59.14 seconds. In contrast, statements keep the value in the meta.duration property as an integer: e.g., 59140 = 59,140 milliseconds. Because meta.duration is a number, you can use it to calculate the heights of columns in a bar chart.

Duration Conversion Factors

If you want to show values in units other than milliseconds, then in Chart Builder, under Data Settings > Metric Scale, enter one of these conversion factors:
  1. 0.001 seconds
  2. 1.66667e-5 minutes
  3. 2.77778e-7 hours
  4. 1.15741e-8 days
In Metric Builder and List Builder, you do it by adding an inline mathematical operation in the title or subtitle: e.g., ${value.metric * 0.001}.

In VQL, you convert duration by adding a stage that performs the needed math: "$addFields": {"metric": {"$multiply": ["$metric", 2.77778e-7]}}.



    • Related Articles

    • How Do I Build a Sankey Chart?

      How to Build a Sankey Chart If you want to analyze navigation patterns in your course, then you can show branching — and even abandonment — with a Sankey chart. How to create — In an Advanced Graph Query widget, insert code like this… { "title": ...
    • Will LRS Reporting Work with a SCORM Package?

      No. Although an authoring tool may offer the option to enable “Report to an external LRS” for packages other than xAPI and cmi5, those other SCORM or AICC packages do not send xAPI statements to an LRS. The courseware player in each package matches ...
    • What Types of Metrics and Dashboards Can I Create with Articulate Storyline and Rise xAPI Data?

      What features do Articulate Storyline and Rise offer that make good use cases for the Veracity Learning LRS dashboard to help analyze learning performance metrics? In this article, the star ratings show the degree to which Articulate offers xAPI to ...
    • What is Veracity Launch and How Does it Work?

      Veracity Launch is a SaaS solution for e-learning content playback and hosting. It can be used instead of an LMS to provide learners with a content portal for launching content. It provides the ability for learners to enroll and complete courses and ...
    • How Do I Show Percent of Students?

      In a custom dashboard, you can easily build a bar chart that shows the number of unique students per course. Chart Builder with simulated data offered in the free Veracity Learning LRS. Problem But what if you want to show the number of unique ...