Bin
2025-12-17 dcf780a91c16b6be28635b6e2e0e702060ee19f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!-- {"title": "Import JSON", "category": "time-series", "complexity": "basic", "order": "3"} -->
 
<!-- readme
### Notes
 
* JSON is a native format for Label Studio and it allows to store time series data right in LS task.
<a target="_blank" href="https://labelstud.io/guide/tasks.html">Read more about LS tasks in documentation.</a>
 
* JSON is necessary when you need to combine multiple data source in one task.
For example, you mix two CSV files for time series into one labeling task or
if you try to build Text + TimeSeries configuration.
 
### Quickstart
 
1. Prepare JSON-formatted input:
 
    ```json
    {
      "ts": {
        "time": [0,1,2],
        "first_column": [3,4,5],
        "second_column": [6,7,8]
      }
    }
    ```
 
2. Set your data keys in the following attributes:
    * `timeColumn="time"`
    * `column="first_column"` and `column="second_column"`
 
3. Add more `<Channel>` tags for more columns if needed
 
    Read more about
<a href="https://labelstud.io/tags/timeseries.html" target="_blank">TimeSeries</a>,
<a href="https://labelstud.io/tags/timeserieslabels.html" target="_blank">TimeSeriesLabels</a>,
<a href="https://labelstud.io/tags/timeseries.html#Channel" target="_blank">Channel</a>.
-->
 
<View>
    <Header value="Time Series from JSON"
            style="font-weight: normal"/>
 
    <TimeSeriesLabels name="label" toName="ts">
        <Label value="Anomaly" background="#a4a"/>
        <Label value="Ordinary" background="#aa4"/>
    </TimeSeriesLabels>
 
    <TimeSeries timeColumn="time"
                name="ts" value="$ts" valueType="json">
        <Channel column="first_column"
                 strokeColor="#1f77b4"/>
        <Channel column="second_column"
                 strokeColor="#ff7f0e"/>
    </TimeSeries>
</View>