From e4a65fc4199465bfe1a0920d30c0c7bc2aa72711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Benitte?= Date: Sat, 21 Dec 2019 08:03:25 +0900 Subject: [PATCH] fix(legends): honor theme font settings for labels --- packages/legends/src/canvas/index.js | 2 ++ website/src/pages/choropleth/canvas.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/legends/src/canvas/index.js b/packages/legends/src/canvas/index.js index d52ee1631..f0c574d18 100644 --- a/packages/legends/src/canvas/index.js +++ b/packages/legends/src/canvas/index.js @@ -86,6 +86,8 @@ export const renderLegendToCanvas = ( ctx.save() ctx.translate(x, y) + ctx.font = `${theme.legends.text.fontSize}px ${theme.legends.text.fontFamily || 'sans-serif'}` + data.forEach((d, i) => { const itemX = i * xStep + padding.left const itemY = i * yStep + padding.top diff --git a/website/src/pages/choropleth/canvas.js b/website/src/pages/choropleth/canvas.js index 5658bd5f0..36d853948 100644 --- a/website/src/pages/choropleth/canvas.js +++ b/website/src/pages/choropleth/canvas.js @@ -61,7 +61,7 @@ const initialProperties = { translateX: 20, translateY: -60, itemsSpacing: 0, - itemWidth: 86, + itemWidth: 92, itemHeight: 18, itemDirection: 'left-to-right', itemOpacity: 0.85,