Skip to content

Commit

Permalink
fix: Update ChartWidget fontFamily handling to respect system default (
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulbarwal authored Jan 21, 2025
1 parent c223c50 commit 16e121c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/client/src/widgets/ChartWidget/widget/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe("emptyChartData", () => {
};

describe("font family", () => {
it("uses theme font family with Nunito Sans fallback", () => {
it("Does not use any font family as a fallback", () => {
const widget = new ChartWidget(defaultProps);
const view = widget.renderChartWithData();

Expand All @@ -69,7 +69,7 @@ describe("emptyChartData", () => {
).renderChartWithData();

expect(viewWithoutFont.props.children.props.fontFamily).toEqual(
"Nunito Sans",
undefined,
);
});
});
Expand Down
6 changes: 5 additions & 1 deletion app/client/src/widgets/ChartWidget/widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ class ChartWidget extends BaseWidget<ChartWidgetProps, WidgetState> {
customEChartConfig={this.props.customEChartConfig}
customFusionChartConfig={this.props.customFusionChartConfig}
dimensions={this.props}
fontFamily={this.props.fontFamily ?? "Nunito Sans"}
fontFamily={
this.props.fontFamily !== "System Default"
? this.props.fontFamily
: undefined
}
hasOnDataPointClick={Boolean(this.props.onDataPointClick)}
isLoading={this.props.isLoading}
isVisible={this.props.isVisible}
Expand Down

0 comments on commit 16e121c

Please sign in to comment.