Unless you want to give out the same result, you want to do:

    return [
      'charts' => $output,
      '#attached' => [
        // Pushing down data to JS.
        'drupalSettings' => [
          'tc' => $data,
        ],
        // Including our own JS "library". Dependencies for it (like Chart.js,
        // Chart.Scatter and jQuery) are handled by tc.libraries.yml.
        'library' => [
          'tc/tc',
        ],
      ],
      '#cache' => [
        'max-age' => 0,
      ],
    ];

Comments

Fabianx created an issue. See original summary.

  • Boobaa committed 411af50 on 8.x-1.x
    Issue #2609164 by Fabianx: Fixed TcDisplayController is cached in...
boobaa’s picture

Status: Active » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.