Type alias CursorFormatter<ChartType, SolveResultType>

CursorFormatter<ChartType, SolveResultType>: ((chart: ChartType, hit: SolveResultType, hits: SolveResultType[]) => ResultTableContent)

Type Parameters

Type declaration

    • (chart: ChartType, hit: SolveResultType, hits: SolveResultType[]): ResultTableContent
    • Callback function which is used to specify text and other content displayed in cursor result tables. Receives 3 parameters:

      1. reference to owning chart
      2. generic SolveResult object that contains information about the pointed data
      3. list of SolveResult objects in case of "show-all" behavior

      In order to use series specific data properties (e.g. Heatmap sample "intensity"), you should use type guards to assert the type of the SolveResult:

       // Example of using type guard in cursor formatter
      Chart.setCursorFormatting((chart, hit, hits) => {
      if (!isHitHeatmap(hit)) return undefined
      return [hit.intensity.toFixed(1)]
      })

      Parameters

      • chart: ChartType
      • hit: SolveResultType
      • hits: SolveResultType[]

      Returns ResultTableContent