title: How to implement data in chart_flutter time series?
body: <p>I am trying to implement api data inside of chart_flutter time series. But i have a problem while implement it. Here is how my code look below:</p>
  <pre><code>class TankChart extends StatefulWidget {
    TankChart({Key key}) : super(key: key);
    @override
    _TankChartState createState() =&gt; _TankChartState();
  }
  
  class _TankChartState extends State&lt;TankChart&gt; {
    var ping;
  List&lt;charts.Series&lt;TankPingProvider, dynamic&gt;&gt; series = [
          charts.Series(
            id: 'Tank Ping',
            data: ping,
            domainFn: (TankPingProvider pings, _) =&gt; pings.tankPing[number.toString()][index].trackedAt,
            measureFn: (TankPingProvider pings, _) =&gt; pings.tankPing[number.toString()][index].volume
          )
        ];
  
        return charts.TimeSeriesChart(
          series,
          animate: true,
        );
       
      });
    }
  }
  </code></pre>
  <p>As you can see, i have error in this line of code:</p>
  <pre><code>data: ping,
  </code></pre>
  <p>and here:</p>
  <pre><code>series,
  </code></pre>
  <p>The error is:</p>
  <pre><code>The argument type 'TankPingProvider' can't be assigned to the parameter type 'List&lt;TankPingProvider&gt;'.
  </code></pre>
  <p>Is there anyway to implement the data?</p>
  <p>Here is how my api look:</p>
  <pre><code>{
      &quot;1&quot;: [
          {
              &quot;tracked_at&quot;: &quot;2020-11-29T17:33:42.000000Z&quot;,
              &quot;fuel&quot;: 71.05,
              &quot;level&quot;: 2.4867087,
              &quot;volume&quot;: 41671.1
          },
          {
              &quot;tracked_at&quot;: &quot;2020-11-30T01:41:41.000000Z&quot;,
              &quot;fuel&quot;: 70.04,
              &quot;level&quot;: 2.451534,
              &quot;volume&quot;: 41031.36
          },
          {
              &quot;tracked_at&quot;: &quot;2020-11-30T01:44:05.000000Z&quot;,
              &quot;fuel&quot;: 68.47,
              &quot;level&quot;: 2.396358,
              &quot;volume&quot;: 40015.56
          },
          {
              &quot;tracked_at&quot;: &quot;2020-11-30T01:46:47.000000Z&quot;,
              &quot;fuel&quot;: 66.89,
              &quot;level&quot;: 2.341182,
              &quot;volume&quot;: 38985.96
          },
  ]
  }
  </code></pre>
  <p>And i use model instead of series. Here is how my model looks like:</p>
  <pre><code>import 'dart:convert';
  
  Map&lt;String, List&lt;TankPing&gt;&gt; tankPingFromJson(dynamic str) =&gt; Map.from(json.decode(str)).map((k, v) =&gt; MapEntry&lt;String, List&lt;TankPing&gt;&gt;(k, List&lt;TankPing&gt;.from(v.map((x) =&gt; TankPing.fromJson(x)))));
  
  String tankPingToJson(Map&lt;String, List&lt;TankPing&gt;&gt; data) =&gt; json.encode(Map.from(data).map((k, v) =&gt; MapEntry&lt;String, dynamic&gt;(k, List&lt;dynamic&gt;.from(v.map((x) =&gt; x.toJson())))));
  
  class TankPing {
      TankPing({
          this.trackedAt,
          this.fuel,
          this.level,
          this.volume,
      });
  
      DateTime trackedAt;
      double fuel;
      double level;
      double volume;
  
      factory TankPing.fromJson(Map&lt;String, dynamic&gt; json) =&gt; TankPing(
          trackedAt: DateTime.parse(json[&quot;tracked_at&quot;]),
          fuel: json[&quot;fuel&quot;].toDouble(),
          level: json[&quot;level&quot;].toDouble(),
          volume: json[&quot;volume&quot;].toDouble(),
      );
  
      Map&lt;String, dynamic&gt; toJson() =&gt; {
          &quot;tracked_at&quot;: trackedAt.toString(),
          &quot;fuel&quot;: fuel,
          &quot;level&quot;: level,
          &quot;volume&quot;: volume,
      };
  }
  </code></pre>
  <p>Any help would be appreciate.</p>