活动识别
如果您想对人类活动识别进行时间序列分类,可以使用此模板对多个时间序列通道中的不同活动进行分类。
交互式模板预览
标注配置
<View>
<TimeSeriesLabels name="label" toName="ts">
<Label value="Run" background="red"/>
<Label value="Walk" background="green"/>
<Label value="Fly" background="blue"/>
<Label value="Swim" background="#f6a"/>
<Label value="Ride" background="#351"/>
</TimeSeriesLabels>
<TimeSeries name="ts" valueType="url" value="$timeseriesUrl"
sep=","
timeColumn="time"
timeFormat="%Y-%m-%d %H:%M:%S.%f"
timeDisplayFormat="%Y-%m-%d"
overviewChannels="velocity">
<Channel column="velocity"
units="miles/h"
displayFormat=",.1f"
strokeColor="#1f77b4"
legend="Velocity"/>
<Channel column="acceleration"
units="miles/h^2"
displayFormat=",.1f"
strokeColor="#ff7f0e"
legend="Acceleration"/>
</TimeSeries>
</View>
关于标注配置
所有标注配置必须包含在View标签内。
使用TimeSeriesLabels控制标签来提供标注者可应用于时间序列图表区域的标签列表:
<TimeSeriesLabels name="label" toName="ts">
<Label value="Run" background="red"/>
<Label value="Walk" background="green"/>
<Label value="Fly" background="blue"/>
<Label value="Swim" background="#f6a"/>
<Label value="Ride" background="#351"/>
</TimeSeriesLabels>
使用TimeSeries对象标签来指定时间序列数据源。valueType="url"参数表示时间序列数据以URL形式提供而非文件,value="$csv"参数指定URL存储在名为timeseriesUrl的数据键中。sep=","参数指定逗号作为数据分隔符,这是CSV格式文件的标准。时间参数用于指定包含时间数据的列、文件中时间数据的格式以及在标注界面上显示时间数据的方式。
<TimeSeries name="ts" valueType="url" value="$timeseriesUrl"
sep=","
timeColumn="time"
timeFormat="%Y-%m-%d %H:%M:%S.%f"
timeDisplayFormat="%Y-%m-%d"
overviewChannels="velocity">
<Channel column="velocity"
units="miles/h"
displayFormat=",.1f"
strokeColor="#1f77b4"
legend="Velocity"/>
<Channel column="acceleration"
units="miles/h^2"
displayFormat=",.1f"
strokeColor="#ff7f0e"
legend="Acceleration"/>
</TimeSeries>
TimeSeries标签中的overviewChannels参数用于指定时间序列数据中要作为通道显示在时间序列图表上的列。
接下来,您可以使用Channel标签及其参数来提供每个通道的详细信息,例如列名、数据单位、使用d3格式的通道数据displayFormat、高亮显示通道时使用的strokeColor,以及该通道在标注界面图例中应显示的名称。