Skip to content

Commit

Permalink
#3221: Charts | Tree: Add possibility to change the font size
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksashka11 committed Jan 15, 2025
1 parent 3a7dcbc commit 3a3170b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/Charts/src/viewers/tree/tree-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class TreeViewer extends EChartViewer {
selectionColor = DG.Color.toRgb(DG.Color.selectedRows);
applySizeAggr: boolean = false;
applyColorAggr: boolean = false;
fontSize: number;

constructor() {
super();
Expand All @@ -55,6 +56,7 @@ export class TreeViewer extends EChartViewer {
this.colorColumnName = this.string('colorColumnName');
this.colorAggrType = <DG.AggregationType> this.string('colorAggrType', DG.AGG.AVG, { choices: this.aggregations });
this.hierarchyColumnNames = this.addProperty('hierarchyColumnNames', DG.TYPE.COLUMN_LIST);
this.fontSize = this.int('fontSize', 12);

this.option = {
tooltip: {
Expand All @@ -69,7 +71,7 @@ export class TreeViewer extends EChartViewer {
position: 'left',
verticalAlign: 'middle',
align: 'right',
fontSize: 9,
fontSize: this.fontSize,
},

leaves: {
Expand Down Expand Up @@ -134,13 +136,15 @@ export class TreeViewer extends EChartViewer {
this.render();
}
if (p?.name === 'hierarchyColumnNames' || p?.name === 'sizeColumnName' ||
p?.name === 'sizeAggrType' || p?.name === 'colorColumnName' || p?.name === 'colorAggrType') {
p?.name === 'sizeAggrType' || p?.name === 'colorColumnName' || p?.name === 'colorAggrType' || p?.name === 'fontSize') {
if (p?.name === 'hierarchyColumnNames')
this.chart.clear();
if (p?.name === 'colorColumnName' || p?.name === 'colorAggrType')
this.applyColorAggr = this.shouldApplyAggregation(this.colorColumnName, this.colorAggrType);
if (p?.name === 'sizeColumnName' || p?.name === 'sizeAggrType')
this.applySizeAggr = this.shouldApplyAggregation(this.sizeColumnName, this.sizeAggrType);
if (p?.name === 'fontSize')
this.option.series[0].label.fontSize = p.get(this);
this.render();
} else
super.onPropertyChanged(p, render);
Expand Down

0 comments on commit 3a3170b

Please sign in to comment.