question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Composite Chart Not Rescaling Bar Width

See original GitHub issue

I have been using the following to rescale bar widths when resizing a full-width chart, where width is assigned by the anchor set at 100% in CSS:

chart.on('preRender', function(){
    chart.rescale();
});

$("#some-chart").on("resize", function(){
    chart.render();
});

Which works perfectly if chart is a bar chart. However, if the bar chart is part of a composition, where chart is the composite chart, bar widths no longer rescale.

It seems that _chart.xAxisLength() in calculateBarWidth is not reflecting the new width.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
palotebcommented, Jun 21, 2016

It’s almost two years late but it can be fixed if you assign the xAxisLength of the composite chart to the xAxisLength of the child bar charts:

childBarChart.xAxisLength = compositeChart.xAxisLength;

0reactions
gordonwoodhullcommented, Oct 3, 2019

Fixed by #1365 in 3.1.5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic scaling & brush off composite charts dc js
I have a composite chart using dc js (line and bar chart). However, the scales are not dynamically changing as is the case...
Read more >
dynamically resize the column thickness by dragging the cursor in a ...
Hi,. Is it possible to dynamically resize the bin(column\bar) thickness of a stacked column chart. I am using a composite chart comprising of...
Read more >
Stacked bar chart — Matplotlib 3.6.2 documentation
This is an example of creating a stacked bar plot with error bars using bar . ... 3] width = 0.35 # the...
Read more >
Google Charts Release Notes
You can load either the production or the release candidate (but not both at once), ... Now supports variable-width in bar, column, and...
Read more >
Azure Monitor workbook grid visualizations - Microsoft Learn
Time range, The time window to view the log chart. ... If a value is present in the Custom Column Width field with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found