title: How to display data from a Tick Selection in a Flutter Chart?
body: <p>I'm making a Time Series Chart in Flutter (charts_flutter package) as shown below, and I would like to display the related data to the tick when the user selects it. What do I need to add to my code?</p>
  <p><a href="https://i.stack.imgur.com/VgSan.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VgSan.png" alt="My time series desplayed" /></a></p>
  <p>I´m using a Widget that I call from different Widgets in my App. The widget code to generate TimeSeriesChart is:</p>
  <pre><code>    Widget graficoLinealDoble(BuildContext context, List&lt;DateTime&gt; listOfFechas, List&lt;double&gt; listOfCantidades, List&lt;DateTime&gt; listOfFechas2, List&lt;double&gt; listOfCantidades2,String titulo, String subtitulo, String medidaSubtitulo, [String color = '#E0B872', String color2 = '#E5E5E9']) {
      
     // Create titles of Chart
  
        return Column(
                 children: &lt;Widget&gt;[
                   SizedBox(height: 8.0),
                   Text('$titulo', maxLines: 1, overflow: TextOverflow.fade, softWrap: false,
                        style: TextStyle(fontSize: 18.0, color: Theme.of(context).primaryColor, fontWeight: FontWeight.bold)),
                   Row(
                     mainAxisAlignment: MainAxisAlignment.center,
                     children: [
                       Text('$subtitulo ', style: TextStyle(fontSize: 26.0, color: Colors.grey[700])),
                       Text('$medidaSubtitulo', style: TextStyle(fontSize: 16.0, color: Theme.of(context).primaryColor),  strutStyle: StrutStyle(fontSize: 26.0)),
                      //  267,30:                 Text(unidad, strutStyle: StrutStyle(fontSize: 22.0), textAlign: TextAlign.center, style: TextStyle(fontSize: 10.0, color: Theme.of(context).primaryColor),),
                     ],
                   ),
                     Flexible(
                       child: EndPointsAxisTimeSeriesChart(_crearLinea(listOfFechas, listOfCantidades, color, listOfFechas2, listOfCantidades2, color2), animate: true)
                     ),
                 ],
               );
          
      }
      
        /// Create series list with multiple series
        List&lt;charts.Series&lt;TimeSeriesSales, DateTime&gt;&gt; _crearLinea(List&lt;DateTime&gt; listOfFechas, List&lt;double&gt; listOfCantidades, String color, List&lt;DateTime&gt; listOfFechas2, List&lt;double&gt; listOfCantidades2, String color2) {
      
          List&lt;charts.Series&lt;TimeSeriesSales, DateTime&gt;&gt; _listSeries;
          _listSeries = List&lt;charts.Series&lt;TimeSeriesSales, DateTime&gt;&gt;();
      
          List&lt;TimeSeriesSales&gt; _listTimeSeriesSales2 = new List();
          List&lt;TimeSeriesSales&gt; _listTimeSeriesSales  = new List();
      
          for (var i = 0; i &lt; listOfFechas2.length; i++) {
            _listTimeSeriesSales2.add(TimeSeriesSales(listOfFechas2[i], listOfCantidades2[i]));
          }
      
          for (var i = 0; i &lt; listOfFechas.length; i++) {
            _listTimeSeriesSales.add(TimeSeriesSales(listOfFechas[i], listOfCantidades[i]));
          }
      
      
          _listSeries.add(charts.Series&lt;TimeSeriesSales, DateTime&gt;(
              id: 'Consumos2',
              strokeWidthPxFn: (TimeSeriesSales sales, _) =&gt; 4,
              colorFn: (_, __) =&gt; charts.Color.fromHex(code: color2),
              domainFn: (TimeSeriesSales sales, _) =&gt; sales.time,
              measureFn: (TimeSeriesSales sales, _) =&gt; sales.sales,
              data: _listTimeSeriesSales2
          ));
      
      
          _listSeries.add(charts.Series&lt;TimeSeriesSales, DateTime&gt;(
              id: 'Consumos',
              strokeWidthPxFn: (TimeSeriesSales sales, _) =&gt; 4,
              colorFn: (_, __) =&gt; charts.Color.fromHex(code: color),
              domainFn: (TimeSeriesSales sales, _) =&gt; sales.time,
              measureFn: (TimeSeriesSales sales, _) =&gt; sales.sales,
              data: _listTimeSeriesSales
          ));
                   
          return _listSeries;
        }
      
      
  
  // Create the Time Series Chart
  
        class EndPointsAxisTimeSeriesChart extends StatelessWidget {
          final List&lt;charts.Series&gt; seriesList;
          final bool animate;
      
          EndPointsAxisTimeSeriesChart(this.seriesList, {this.animate});
      
      
            @override
            Widget build(BuildContext context) {
              return new charts.TimeSeriesChart(
                seriesList,
                animate: animate,
                domainAxis: new charts.DateTimeAxisSpec(),
                dateTimeFactory: const charts.LocalDateTimeFactory(),
                primaryMeasureAxis: charts.NumericAxisSpec(
                  tickProviderSpec: new charts.BasicNumericTickProviderSpec(desiredTickCount: 4,),
                ),
                defaultRenderer: new charts.LineRendererConfig(
                  includePoints: false,
                  includeArea: false,
                ),
              );
            }
      }
      
      /// Sample time series data type.
      class TimeSeriesSales {
        final DateTime time;
        final double sales;
      
        TimeSeriesSales(this.time, this.sales);
      }
  </code></pre>
  <p>How can data related to user selection be displayed on a Flutter chart?</p>