Skip to content

Commit

Permalink
fix(legends): honor theme font settings for labels
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Dec 21, 2019
1 parent b199b27 commit e4a65fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/legends/src/canvas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/choropleth/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e4a65fc

Please sign in to comment.