-
Notifications
You must be signed in to change notification settings - Fork 357
Question: Titles make me crazy / sorry #3964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
FYI. I noticed on the webpage https://d3js.org/d3.v6.min.js however the v7 is available: https://d3js.org/d3.v7.min.js The goal, is to have on a same webpage several graphics (type lines and type gauge) with the first line of the title in 17px and bold and the second line if any in 14px not bold After several tries, I detect that adding a second line to each title for each graphic solve the problem. I will be happy to read you @netil |
You need to deal with some css styling and specify correct css selector for this.
@Phil353556. do /* style for the first line of title */
.bb-title tspan:first-child {
font-size: 17px;
font-weight: bold;
}
/* style for the second line of title */
.bb-title tspan:nth-child(2) {
font-size: 14px;
} |
hello @netil, |
@Phil353556, the css rules selects "titles" regardless the chart type. |
Hello @netil Here attached is an example, I will be happy to read you |
Hello @Phil353556, Please always create a jsfiddle or something similar for easy checking. (https://jsfiddle.net/) I have created one for this now: This is a CSS /HTML issue more than a library issue. When there is only one line of title, billboard does not create any tspan elements, but only one text element with the class "bb-title". You could have easily checked that by inspecting with eg. chrome. (right-click the title and click inspect). replace your css with this:
you also need the text.bb-title as it only takes precedence like that due to the order of style loading. |
@heppa You're incredible! Thank you so much for your answer Have a good day |
Thanks but nope, @netil is for providing this incredible library ! ;)
You too and good luck! |
Hello,
I tried without success, I didn't success to have several graphics on a single webpage with a title in bold for each. What I'm missing?
Is there a specific order to include
.bb-title tspan:first-child { font-size: 17px; font-weight: bold; }
is it correct to put tspan:first-child or is it another parameter ?
testtitle.html.txt
Thanks
Phil
The text was updated successfully, but these errors were encountered: