How to Find Total number of legends in amcharts? - css

actually i want to set min height of chart excluding legends, my problem is when i choose small screen then legends are coming in one line and it will take lots of height and chart height is very small. so i am trying to do is that chart minimum height is remaining and if legends are more then it will take space accordingly. i know about legends scrollable give max height and setting scrollbar, but i want legends showing without scrollbar and chart min height is also showing, it is not an issue if graph is going big
actually i want to set min height of chart excluding legends, my problem is when i choose small screen then legends are coming in one line and it will take lots of height and chart height is very small. so i am trying to do is that chart minimum height is remaining and if legends are more then it will take space accordingly. i know about legends scrollable give max height and setting scrollbar, but i want legends showing without scrollbar and chart min height is also showing, it is not an issue if graph is going big

Related

How to have a grid of items with a consistent row width and gaps using css?

I am wanting create a display wall (rows) of images with various aspect rations. (Think like an Instagram wall, but with different sized images, not just square crops)
However, I want the left and right margins to be aligned and for there to be a constant spacing between each image.
So the way to do this is to have the height of each row vary so that the width of each images expands until it is the right width to completely full up the required space.
I could use JavaScript to keep a running tally of the space available and math that against the aspect ratio of each of images.
However I feel this is something I can/should do in (more or less) vanilla css (perhaps using flexbox).
How do I create a table/grid of images, with each row an equal width; with a varied row height, to leave a consistent gap between each of the images? (with a minimal amount of js)
I am wanting to display a wall (rows) of images of various aspect rations. (Think like an Instagram wall but with different sized images, not just square crops)
However, I want the left and right margins to be aligned and for there to be a constant spacing between each image.
So the way to do this is to have the height of each row vary so that the width of each images expands until it is the right width to completely full up the required space.
I could use JavaScript to keep a running tally of the space available and math that against the aspect ratio of each of images.
However I feel this is something I can do in (more or less) vanilla css (perhaps using flexbox).
How do I create a table/grid of images, with each row an equal width; with a varied row height, to leave a consistent gap between each of the images? (with a minimal amount of js)

How to control scroll bars in Angular UI Grid

I'm using Angular UI Grid in a project. The grid sizes itself so that all the columns fit horizontally in a div.
This works great, until there are more rows than fit on one screen. Then, a vertical scroll bar comes up (good), which covers part of the last column (bad). Horizontal scroll bars can be enabled to reach those last 20 or so px, but when you scroll horizontally, the header cells don't scroll. This throws everything out of alignment.
Since the grid was perfectly sized before the scroll bar, there should not be a need for the horizontal scroll bar. But the way the scroll bar covers the content means that without it, you can't see anything that might be in the right 20 or so px.
I need to fix this. Here are some solutions I have looked into implementing, unsuccessfully:
Find some way to know if there is a vertical scroll bar and add padding or margin somewhere to push in the content of both the header cell and the data cell, to keep things in alignment. I haven't found an easy way to grab the container who may or may not have a scroll bar and then I think the logic to ask it if it has a scroll bar would be brittle. Plus, just playing around with adding padding where I think it should go did not effectively push over the content.
Find a way to let the container with the scroll bar push outside of the grid when it has a scroll bar. This has basically the same issue as #1 in that that guy is pretty slippery.
Find a way to replace the scroll bar with my own. It seems that there is someone who did a branch that lets you do this with a specific library, but we are tied to a specific commit of UI Grid and adding libraries takes an act of congress.
Thoughts?
How you can know if there is a vertical scrollbar :
If you haven't customized the rows with a rowTemplate, then you might be having a rowHeight of 30px (if not please inspect).
var dataRowHeight = (numberOfRows * 30) + padding (if you have);
var gridElementHeight = angular.element("#my-ui-grid-div-id")[0].offsetHeight;
if (dataRowHeight > gridElementHeight) {
// you have a verticalscrollbar
}
Safe side : specify width for all columns by % and leave 1% behind for the scrollbar.
Ugly side : Get the width of the 'viewport', loop through and calculate the actual pixels from your provided percentage for all columns, if you detect a vertical scrollbar using the technique above, leave 15px behind.

Setting the maximum width of a Bokeh plot

I understand that I can make a Bokeh plot responsive to the width of a div by setting responsive=True. However, I am interested in having the Bokeh plot only be responsive up to a point. Is there a method so that I can set the maximum width of the Bokeh plot so that the figure is not responsive up to a certain div width? I have looked in the documentation but to no avail.
As of Bokeh 0.13.0 there is no such explicit option. However, bokeh plots (and other layout items) now have a sizing_mode property with a wider range of options: "fixed", "stretch_both", "scale_width", "scale_height", and "scale_both". So if you can put a Bokeh plot with one of the non-fixed sizing modes in div that responds the way you describe (e.g. perhaps a Bootstrap container) then the plot will respond accordingly.
Two of the options to limit the maximum size a responsive bokeh plot can reach that worked for me are:
To have the bokeh layout stretch across the whole width of the div I used sizing_mode="scale_both" and then used max_width= to limit the maximum size the plot can reach within the layout. I also tried max_height= but that did not work.
Alternatively, limit the width of the div of the bokeh layout div with
<div style="max-width: ">. Here, again, <div style="max-height: "> did not work.

Image too small for parallax?

The image in the bottom of the parallax theme appears to be too small. If you expand your browser to full height you will see that it is showing spacing on the bottom.
My first guess is that the image is too small. However the height is actually larger than the one I'm using on the top widget area. Should I get a larger picture or is there something I can do with css?
URL: jeff-cunningham.com
It is using the width to scale the height. So to get the height you desire, you need to make sure the proportions of the image are enough to go down far enough.
As an easy example lets say your page is 1000pxs wide. You need the image to go down 2000pxs. You would then need your height to be 2 times bigger than your width. A picture with a width of 1500pxs and a height of 2000pxs would not work because the image would scale to a width of 1000pxs and a height of 1333pxs.

flex TileLayout - want equal tile width but not height

I am working on a Flex mobile project and am using a TileLayout to layout a bunch of groups. The problem is, if any text in one of the groups spans several lines, ALL tiles get resized to the same height. I need the tile width to be the same for all tiles, but I want the tile height to be the tallest only on each row. Thanks for the help.
I found a work-around for this. I had to write a custom layout that calculates the number of columns and the max height for each row.

Resources