FERNman / angular-google-charts

A wrapper for the Google Charts library written in Angular.
Other
273 stars 107 forks source link

broaden type Row in chart-base.component.ts #302

Closed kussmaul closed 1 year ago

kussmaul commented 1 year ago

Bug Report

Description

I am using angular-google-charts 2.2.3 with typescript 5.1.6 and angular 16.2.2.

The file chart-base.component.ts defines type Row: export type Row = (string | number | Date | null)[];

Please expand the options to include boolean and { v: any, f: string } (for formatters, as described in README.md). Currently, I get errors like the one shown below when passing data with booleans and/or formatters to <dashboard> or <google-chart>, although if I suppress the errors using $any() the data is accepted and works correctly.

Type 'MyData[]' is not assignable to type 'Row[]'.
    Type 'MyData' is not assignable to type 'Row'.
      Type 'string | boolean | Date' is not assignable to type 'string | number | Date | null'.
        Type 'false' is not assignable to type 'string | number | Date | null'.ngtsc(2322)
kussmaul commented 1 year ago

duplicate of #297