Tooltips

Toolips can be bound to glyphs using the tooltip function. The tooltip function takes a TooltipConfig as an argument.

let chart = new soda.Chart({
  selector: "#soda-chart",
  axis: true,
  zoomable: true,
    inRender: function (this, params): void {
    soda.rectangle({
      chart: this,
      annotations: params.annotations || []
    })

    soda.tooltip({
      annotations: params.annotations,
      text: (d) => d.a.id
    })
  }
});

let ann: Soda.Annotation = soda.generateAnnotations({
  n: 10
})

chart.render({
  annotations: ann
})

See the Pen SODA tooltips by Jack Roddy (@jackroddy) on CodePen.