Skip to content

Commit

Permalink
feat(charts/radial-bar): add color input for radial bar #1816
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 11, 2024
1 parent 19d7853 commit b6b65d7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/doc/src/app/charts/radial-bar/radial-bar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
[width]="width"
[yField]="yField"
[options]="options"
[color]="color"
></prizm-charts-radial-bar>
</prizm-doc-demo>
<prizm-doc-documentation>
Expand Down Expand Up @@ -90,6 +91,14 @@
>
Y Field Name
</ng-template>
<ng-template
[(documentationPropertyValue)]="color"
documentationPropertyName="color"
documentationPropertyType="string"
documentationPropertyMode="input"
>
Color. Sets charts color. Note, for chart with seriesField use colors array.
</ng-template>
</prizm-doc-documentation>
</ng-template>

Expand Down
1 change: 1 addition & 0 deletions apps/doc/src/app/charts/radial-bar/radial-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class RadialBarComponent {
];
public xField = 'name';
public yField = 'star';
color = '';

public options: Partial<PrizmChartsRadialBarOptions> = {
radius: 0.8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ export class PrizmChartsRadialBarComponent<
return this.origin?.options?.data;
}

@Input()
public set color(value: PrizmChartsRadialBarOptions['color']) {
this.updateOptions({ color: value });
}
public get color(): PrizmChartsRadialBarOptions['color'] {
return this.options.color;
}

@Input()
public set label(value: PrizmChartsRadialBarOptions['label']) {
this.updateOptions({ label: value });
Expand Down

0 comments on commit b6b65d7

Please sign in to comment.