So I have a Flex bar chart that resizes dynamically, and if I have only a few items, the height shrinks and the horizontal axis and label shrink along with it. If the height of the chart is small enough, the label shrink down to practically nothing.
How can I enforce a minimum height for the axis itself? Or even a minimum font size for the labels?
I've tried setting the font size on the axis renderer and the axis label renderer and Flex still wants to resize the labels how it wants.
put a minHeight on the container I believe... but mostly just wanted to point out Axiis to you...
Related
I am preparing a longer report that uses many ggplot bar charts. Since the number of bars change, the bar width also changes, and it doesn't look nice. The documentation says, the bar width is set to 90% of the resolution by default. I want to know if there is a way to set an absolute width size, e.g. 1cm or 0.5inch.
I have a tableview cell that contains a horizontal UIStackView. Inside it is an UIImageView (on the left, 100x100 dimensions) and a vertical UIStackView (on the right) that contains 4 labels. The vertical UIStackView is constrained to the UIImageView's top and bottom anchors. But the bottom constraint is "less than or equal to".
I am setting the text property on these labels but if the text is nil I hide that label. Stack View than sets the height of that label to 0 and it doesn't appear in the Stack View. Now the idea is if some labels are hidden, the combined intrinsic content size's of the remaining labels will define the height of the vertical UIStackView and it will decrease in height based on that "less than or equal to" bottom constraint.
This doesn't work though. Take the case where the 2nd and 4th labels have been hidden. The 1st label is normal height. But the 3rd label stretches all the way down to the bottom of the UIImageView. This is in contrast to my expectation that the intrinsic content sizes of the labels would be less and the label's UIStackView would shrink.
I'm guessing there is some priorities that might need to be tuned to get this working properly. This whole view hierarchy is contained in a UITableViewCell and that has dynamic height applied which I hope doesn't cause any problems.
So if the intended behavior is that when I hide labels the vertical UIStackView shrinks, what constraints must I add/delete or which priorities must be set?
I have a mx.charts.LineChart in Flex and I would like to know how to reduce the padding between the value labels and the tick markers? I've highlighted the region I mean with yellow boxes in the image below.
I'd like the labels to be as close as possible to the tick markers, just a couple of pixels will do.
I only care about applying this to the x-axis.
I'd also be interested to know how to reduce the padding between the axis title (e.g. kB and minutes on chart below) and the value labels.
Use the labelGap style of the AxisRenderer class.
By default it is 3 pixels, you can set it to 0 (or even a negative value if still not close enough).
For positioning the axis title there is no easy solution. You could write the vertical axis title yourself, as a label on top left of the chart. An advantage is that it is much better for the user to read (than the vertical writing).
I have a fixed size label on a QtDesigner form. The label is used to display images, let's assume it's used to display thumbnails of 100x100 px.
I can set the size of the label but when I put the label in some layout manager the labels get resized to take the whole space. Even if I do it through the Form > Layout in a Grid. The size of the labels is shrunk.
I believe this is some corner case as labels are not often used to do such things (although they are meant to be able to display images). Is there a workaround to avoid the size of the labels changing when placed in the layout?
You can set horizontal and vertical size policies to Fixed or set the maximum height and width additionally. Either in code or in Designer.
Note: by width i mean the height here, I use width because by default, bar charts are vertical and flex uses the width property
I want to reduce the width of the following barchart so Type 5, Type 4, Type 3, Type 2, Type 1 are very close to each other. I tried playing with the barWidthRatio, the horizontalAxisRatio and the maxBarWidth properties. Neither is giving me the desired result. I can only manage to reduce the width of the orange bars, how do I reduce the width of the blue bars?
Is there no way to do this?
Im pretty sure your going to have to reduce the height of the whole chart to do that, or the container that contains the chart. The chart is probably set to height=100%, so it will always stretch out those blue bars