-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add overflow option to labels configuration (#106)
* Add overflow option to labels configuration * adds test cases * adds types definition * adds docs and samples * improves check if overflow is hidden * apply review
- Loading branch information
1 parent
2213041
commit 6246d19
Showing
12 changed files
with
203 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
export default { | ||
tolerance: 0.0120, | ||
config: { | ||
type: 'treemap', | ||
data: { | ||
datasets: [{ | ||
label: 'Simple treemap', | ||
data: [6, 6, 4, 3, 2, 2, 1], | ||
backgroundColor: 'red', | ||
labels: { | ||
display: true, | ||
overflow: 'cut', | ||
formatter: (ctx) => ('value is ' + ctx.raw.v + ',').repeat(8).split(',') | ||
} | ||
}] | ||
}, | ||
options: { | ||
layout: { | ||
padding: { | ||
bottom: 10 | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
export default { | ||
tolerance: 0.0025, | ||
config: { | ||
type: 'treemap', | ||
data: { | ||
datasets: [{ | ||
label: 'Simple treemap', | ||
data: [6, 6, 4, 3, 2, 2, 1], | ||
backgroundColor: 'red', | ||
labels: { | ||
display: true, | ||
overflow: 'hidden', | ||
formatter: (ctx) => ('value is ' + ctx.raw.v + ',').repeat(6).split(',') | ||
} | ||
}] | ||
}, | ||
options: { | ||
layout: { | ||
padding: { | ||
bottom: 10 | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
export default { | ||
tolerance: 0.0060, | ||
config: { | ||
type: 'treemap', | ||
data: { | ||
datasets: [{ | ||
label: 'Simple treemap', | ||
data: [6, 6, 4, 3, 2, 2, 1], | ||
backgroundColor: 'red', | ||
labels: { | ||
display: true, | ||
overflow: 'cut', | ||
formatter: (ctx) => ('value is ' + ctx.raw.v).repeat(5) | ||
} | ||
}] | ||
}, | ||
options: { | ||
layout: { | ||
padding: { | ||
bottom: 10 | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export default { | ||
config: { | ||
type: 'treemap', | ||
data: { | ||
datasets: [{ | ||
label: 'Simple treemap', | ||
data: [6, 6, 4, 3, 2, 2, 1], | ||
backgroundColor: 'red', | ||
labels: { | ||
display: true, | ||
overflow: 'hidden', | ||
formatter: (ctx) => ('value is ' + ctx.raw.v).repeat(5) | ||
} | ||
}] | ||
}, | ||
options: { | ||
layout: { | ||
padding: { | ||
bottom: 10 | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters