Skip to content

options are not considered when rendering chart #11

@BigMichi1

Description

@BigMichi1

i tried to set some options for the chart in my controller like this

        $chart->setOptions([
            'title' => ['display'=> true, 'text' => $this->translator->trans('headline', ['%year%' => $year])],
            'legend' => ['display' => true, 'position' => 'bottom'],
        ]);

this is then rendered as

{
  // omitting the data part that works
  "options": {
    "title": {
      "display": true,
      "text": "Statistik 2020"
    },
    "legend": {
      "display": true,
      "position": "bottom"
    }
  }
}

but the check here

if (!payload.options.length) {

replaces the options with an empty object, because payload.options.length is undefined while payload.options contains the options

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions