-
Beta Was this translation helpful? Give feedback.
Replies: 18 comments
-
What versions (Chart.js and chartjs-chart-matrix) are you using? In the latest v3 beta, scales can take up to 50% of the chart area, but before that there was no limitation at all. Also, can you create an interactive example of this behavior? |
Beta Was this translation helpful? Give feedback.
-
I am using chartjs v2.9.4 and implementation from chartjs-chart-matrix v0.1.3. Here is a screen recording of the behavior:
What exactly would need to change in chartjs-chart-matrix v0.1.3 to modify that behavior? And by interactive example, do you mean maybe something on jsfiddle or the like or will the screen recording suffice? My implementation does not deviate in any significant way from your samples. |
Beta Was this translation helpful? Give feedback.
-
Yes, I mean jsfiddle or the like, that reproduces the issue. Screen recording does not suffice, because there is nothing to debug in that :) There should be nothing in chartjs-chart-matrix (any version), that affects hot the scales are laid out, so that's why I need a reproduce that I can debug. |
Beta Was this translation helpful? Give feedback.
-
I'm guessing its the category scale that fails. |
Beta Was this translation helpful? Give feedback.
-
Yes, the scales are category (and the labels are provided at the axes level). |
Beta Was this translation helpful? Give feedback.
-
I am still updating this fiddle (to get the cells to be the size) but this is what I have so far: https://jsfiddle.net/syeanot/k92vujhd/45/ This is how I have implemented it. |
Beta Was this translation helpful? Give feedback.
-
Can't reproduce it like in the video yet (modified a bit): Maybe you need to add the other chart too? |
Beta Was this translation helpful? Give feedback.
-
I have added the bar chart, they both seem to be behaving very similarly: https://jsfiddle.net/syeanot/k92vujhd/143/ |
Beta Was this translation helpful? Give feedback.
-
So, the thing causing the issue is not in the fiddle (yet). Do you have any paddings set to the charts? Any negative values? |
Beta Was this translation helpful? Give feedback.
-
No paddings or negative values on the charts, and the css on the wrappers are the same for both charts. Looking to see if there any other notable differences. |
Beta Was this translation helpful? Give feedback.
-
I can't seem to find any odd external factors in my code base that could be affecting the matrix and not the bar chart (I will keep looking). However, you mentioned, "In the latest v3 beta, scales can take up to 50%". Do you think a similar limitation on the version I am using might have an effect? I am not a chartjs pro :) so not sure where to start there. |
Beta Was this translation helpful? Give feedback.
-
Looks like 2.9.4 at least tries to keep 50% of the width for the chart (that's when the labels start cutting): |
Beta Was this translation helpful? Give feedback.
-
This might be related to: chartjs/Chart.js#8483 |
Beta Was this translation helpful? Give feedback.
-
Interesting, I will have a look at that issue and see if the solution resolves what I have here. |
Beta Was this translation helpful? Give feedback.
-
The fix added for chartjs/Chart.js#8483 does in fact resolve the issue I have outlined here. Any idea when the fix will be released? |
Beta Was this translation helpful? Give feedback.
-
It's been released in 3.0.0-beta.12 |
Beta Was this translation helpful? Give feedback.
-
I see. Is there no chance we can get the fix as a version 2 patch? 2.9.5 maybe? |
Beta Was this translation helpful? Give feedback.
-
I'm not personally investing time in 2.9, but I'm not against that either. |
Beta Was this translation helpful? Give feedback.
This might be related to: chartjs/Chart.js#8483
If you have hidden scales, or legend or title that is positioned left or right, it reduced the given space for visible ones.
The core fix has not been released yet.