Regions and label, what about coordinates?
Hello, This a follow up of https://github.com/naver/billboard.js/issues/3950 with regions now added.
I used what you shared on #3950 . That's great.
And I added "regions" like (labels are months name : Janvier > January, Février -> February and so on)
I ran a few tests and as the number of values on the X axis increased, the label was no longer displayed in the correct region.
The issue I have is about the position of this label. Until 180 values (=6 months) that's ok, then the label is not at the right place. There is a shift on the right.
see screenshots:
OK :
Not Ok :
May you tell me more about coordinates x and y for label? What I should in a perfect world, is to have the label displayed in the center of each region.
best regards / Phil
@Phil353556 can you provide a working example?
Hello @netil, Here it is, rename the file to remove .txt extension several tests possibles with comment or uncomment the lines "values" and "data1". Thank you for your time Phil github3958.php.txt
@Phil353556 is because, specifying x & y coordinate value for each region will make to positioned as is. If you remove (or set x & y both as zero), will make region text to be positioned at the top left, and from that position specify relative values where you want to be.
regions: [
{
start: "1",
end: "31",
label: {
text: "january",
// x: 200, // x coordinate is relative to the region start position(left top)
// y: 50, // y coordinate is relative to the region start position(left top)
color: "red"
}
},
{
start: "32",
end: "59",
label: {
text: "February",
color: "red"
}
},
So, the default coordinate for region text will looks like:
Planning to implement new feature to align region label text at the middle on next release.
Hello @netil Thank you for your answer and thanks for the new feature, that's excellent. Phil