Problem/Motivation

I have the chart module installed and am using a Drupal view to create the bar chart that uses Billboard.js. For the chart design, I want to increase the font size of the labels. If I do that with CSS, parts of the labels get hidden as the chart area doesn't adjust. How do I increase the label font size as the chart is getting rendered? I am assuming I can alter the chart in a custom module, but what do I include in the module to bind to the chart that the view creates using billboard.js and make those styling adjustments?

Issue fork charts-3460607

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 3460607-changing-label-font Comparecompare
  • 1 hidden branch
  • 5.0.x Comparecompare

Comments

fogpuddle created an issue. See original summary.

debdeep.mukhopadhyay’s picture

Assigned: Unassigned » debdeep.mukhopadhyay
debdeep.mukhopadhyay’s picture

debdeep.mukhopadhyay’s picture

Status: Active » Needs work
debdeep.mukhopadhyay’s picture

Status: Needs work » Needs review
StatusFileSize
new329.4 KB
new326.21 KB

If you want to increase font size of the label, you have to pick specific class for the label. After writing the custom CSS, you need to clear the cache & reload the page, only then this changes will be visible... (N.B- sometimes changes in inspect element is not work properly)

debdeep.mukhopadhyay’s picture

Assigned: debdeep.mukhopadhyay » Unassigned
fogpuddle’s picture

Thank you for your response @innoraftDebdeep. I am not getting the same result after increasing the font size of the labeling to 20px. The labeling gets cut off on the left and the font leading isn't increased. I also noticed in the source code in your screenshot that the label text was split out by s. I'm not getting that same result.

Each bar is a paragraph type with a label field and a number value filed that gets pulled into a view that makes the chart.

Attached is a screenshot showing what I'm seeing.

debdeep.mukhopadhyay’s picture

StatusFileSize
new140.68 KB

You can try
.tick text tspan {
font: 36px sans-serif !important;
}
this code.But you have to change bb-axis-x and bb-axis-y both lavel font size should be same and you can't difine different class name for the both lavel you need to use one code which reflect on the both section just like my code.

nikathone’s picture

Version: 5.0.13 » 5.1.x-dev
Status: Needs review » Needs work

Not sure if I am missing something but the fork doesn't contain new codes. I also switched the version to latest chart version and I think this means that the fork might need to be rebased.

bluegeek9 made their first commit to this issue’s fork.

bluegeek9 changed the visibility of the branch 5.0.x to hidden.