No longer include an automatic tooltip in LineChart

It is now required to use the one yielded by the :after named block.
This commit is contained in:
Michael Lange 2021-03-08 21:01:57 -08:00
parent 15b68cc00c
commit f1633e2be0
4 changed files with 15 additions and 14 deletions

View File

@ -293,7 +293,7 @@ export default class LineChart extends Component {
return {
series,
datum: {
formattedX: this.xFormat()(datum[xProp]),
formattedX: this.xFormat(this.args.timeseries)(datum[xProp]),
formattedY: this.yFormat()(datum[yProp]),
datum,
},

View File

@ -51,17 +51,4 @@
data=this.activeData)
) to="after"}}
{{/if}}
{{#unless @dataProp}}
<div class="chart-tooltip is-snappy {{if this.isActive "active" "inactive"}}" style={{this.tooltipStyle}}>
<ol>
<li>
<span class="label">
<span class="color-swatch {{this.chartClass}}" />
{{this.activeDatumLabel}}
</span>
<span class="value">{{this.activeDatumValue}}</span>
</li>
</ol>
</div>
{{/unless}}
</div>

View File

@ -9,6 +9,12 @@
@data={{this.data}} />
</:svg>
<:after as |c|>
<c.Tooltip class="is-snappy" as |series datum|>
<li>
<span class="label"><span class="color-swatch is-primary" />{{datum.formattedX}}</span>
<span class="value">{{datum.formattedY}}</span>
</li>
</c.Tooltip>
<c.VAnnotations
@annotations={{this.annotations}}
@key="event.uid"

View File

@ -13,4 +13,12 @@
<:svg as |c|>
<c.Area @data={{@data}} @colorClass={{@chartClass}} />
</:svg>
<:after as |c|>
<c.Tooltip class="is-snappy" as |series datum|>
<li>
<span class="label"><span class="color-swatch {{@chartClass}}" />{{datum.formattedX}}</span>
<span class="value">{{datum.formattedY}}</span>
</li>
</c.Tooltip>
</:after>
</LineChart>