From ab759cfa2a0551fd3844046cb2ebc0ac698be29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 5 Jul 2023 08:44:01 +0200 Subject: [PATCH] add a label next to the value closes #1733 --- src/channel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/channel.js b/src/channel.js index 38edcc3e2a..019efc2633 100644 --- a/src/channel.js +++ b/src/channel.js @@ -5,13 +5,13 @@ import {registry} from "./scales/index.js"; import {isSymbol, maybeSymbol} from "./symbol.js"; import {maybeReduce} from "./transforms/group.js"; -export function createChannel(data, {scale, type, value, filter, hint}, name) { +export function createChannel(data, {scale, type, value, filter, hint, label}, name) { if (hint === undefined && typeof value?.transform === "function") hint = value.hint; return inferChannelScale(name, { scale, type, value: valueof(data, value), - label: labelof(value), + label: label === undefined ? labelof(value) : label, filter, hint });