fix(localgov_elections): guard scales access and scope setChartColours to election charts only

  • Wrap scales.x and scales.y access in existence checks to prevent TypeError on chart types with no axes (e.g. pie, doughnut)
  • Pass chart ID into setChartColours() and bail early if the chart is not a known election chart ID, preventing backgroundColor being overwritten on unrelated drupal/charts instances on the same page

Closes #3579222

Merge request reports

Loading