2020-07-09 20:19:07 +00:00
|
|
|
<svg data-test-line-chart role="img" aria-labelledby="{{concat "title-" this.elementId}} {{concat "desc-" this.elementId}}">
|
|
|
|
<title id="{{concat "title-" this.elementId}}">{{this.title}}</title>
|
|
|
|
<description id="{{concat "desc-" this.elementId}}">
|
|
|
|
{{#if this.description}}
|
|
|
|
{{this.description}}
|
2018-09-25 04:19:18 +00:00
|
|
|
{{else}}
|
2020-07-09 20:19:07 +00:00
|
|
|
X-axis values range from {{this.xRange.firstObject}} to {{this.xRange.lastObject}},
|
|
|
|
and Y-axis values range from {{this.yRange.firstObject}} to {{this.yRange.lastObject}}.
|
2018-09-25 04:19:18 +00:00
|
|
|
{{/if}}
|
|
|
|
</description>
|
2018-09-07 16:59:02 +00:00
|
|
|
<defs>
|
2020-07-09 20:19:07 +00:00
|
|
|
<linearGradient x1="0" x2="0" y1="0" y2="1" class="{{this.chartClass}}" id="{{this.fillId}}">
|
2018-09-08 01:00:25 +00:00
|
|
|
<stop class="start" offset="0%" />
|
|
|
|
<stop class="end" offset="100%" />
|
|
|
|
</linearGradient>
|
2020-07-09 20:19:07 +00:00
|
|
|
<clipPath id="{{this.maskId}}">
|
|
|
|
<path class="fill" d="{{this.area}}" />
|
2018-09-07 16:59:02 +00:00
|
|
|
</clipPath>
|
|
|
|
</defs>
|
2020-07-09 20:19:07 +00:00
|
|
|
<g class="y-gridlines gridlines" transform="translate({{this.yAxisOffset}}, 0)"></g>
|
|
|
|
<g class="canvas {{this.chartClass}}">
|
|
|
|
<path class="line" d="{{this.line}}" />
|
|
|
|
<rect class="area" x="0" y="0" width="{{this.yAxisOffset}}" height="{{this.xAxisOffset}}" fill="url(#{{this.fillId}})" clip-path="url(#{{this.maskId}})" />
|
|
|
|
<rect class="hover-target" x="0" y="0" width="{{this.yAxisOffset}}" height="{{this.xAxisOffset}}" />
|
2018-09-07 16:59:02 +00:00
|
|
|
</g>
|
2020-07-09 20:19:07 +00:00
|
|
|
<g aria-hidden="true" class="x-axis axis" transform="translate(0, {{this.xAxisOffset}})"></g>
|
|
|
|
<g aria-hidden="true" class="y-axis axis" transform="translate({{this.yAxisOffset}}, 0)"></g>
|
2018-09-07 16:59:02 +00:00
|
|
|
</svg>
|
2020-07-31 22:46:01 +00:00
|
|
|
<div data-test-annotations class="line-chart-annotations" style={{this.chartAnnotationsStyle}}>
|
2020-08-07 00:58:43 +00:00
|
|
|
{{#each this.processedAnnotations key=this.annotationKey as |annotation|}}
|
2020-08-04 02:48:36 +00:00
|
|
|
<div data-test-annotation class="chart-annotation {{annotation.iconClass}} {{annotation.staggerClass}}" style={{annotation.style}}>
|
2020-07-31 22:46:01 +00:00
|
|
|
<button
|
|
|
|
type="button"
|
2020-08-05 18:55:17 +00:00
|
|
|
class="indicator {{if (or
|
|
|
|
(and this.annotationKey (eq-by this.annotationKey annotation.annotation this.activeAnnotation))
|
|
|
|
(and (not this.annotationKey) (eq annotation.annotation this.activeAnnotation))
|
|
|
|
) "is-active"}}"
|
2020-07-31 22:46:01 +00:00
|
|
|
title={{annotation.label}}
|
|
|
|
onclick={{action this.annotationClick annotation.annotation}}>
|
|
|
|
{{x-icon annotation.icon}}
|
|
|
|
</button>
|
|
|
|
<div class="line" />
|
|
|
|
</div>
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
2020-07-09 20:19:07 +00:00
|
|
|
<div class="chart-tooltip is-snappy {{if this.isActive "active" "inactive"}}" style={{this.tooltipStyle}}>
|
2018-09-08 01:00:25 +00:00
|
|
|
<p>
|
|
|
|
<span class="label">
|
2020-07-09 20:19:07 +00:00
|
|
|
<span class="color-swatch {{this.chartClass}}" />
|
|
|
|
{{this.activeDatumLabel}}
|
2018-09-08 01:00:25 +00:00
|
|
|
</span>
|
2020-07-09 20:19:07 +00:00
|
|
|
<span class="value">{{this.activeDatumValue}}</span>
|
2018-09-08 01:00:25 +00:00
|
|
|
</p>
|
2018-09-07 16:59:02 +00:00
|
|
|
</div>
|