Skip to content

Commit

Permalink
Add a condition to Y-axis tickFormatter to display formatted value if…
Browse files Browse the repository at this point in the history
… there's only one series
  • Loading branch information
DianaDerevyankina committed Sep 25, 2020
1 parent 68b06b9 commit fb76b7f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ export class TimeseriesVisualization extends Component {
seriesDataRow.useDefaultGroupDomain = !isCustomDomain;
});

// console.log(series.filter((r) => startsWith(r.id, seriesGroup.id)));

if (isCustomDomain) {
TimeseriesVisualization.addYAxis(yAxis, {
domain,
Expand All @@ -219,7 +221,7 @@ export class TimeseriesVisualization extends Component {
});
} else if (!mainDomainAdded) {
TimeseriesVisualization.addYAxis(yAxis, {
tickFormatter: (val) => val,
tickFormatter: series.length === 1 ? undefined : (val) => val,
id: yAxisIdGenerator('main'),
groupId: mainAxisGroupId,
position: model.axis_position,
Expand Down

0 comments on commit fb76b7f

Please sign in to comment.