Set width of bars in bar graph - android-graphview

Is there a way to control the width of the bars in a bar graph? Currently I am seeing the first and last bars default to half the width of the remaining (middle) bars.

Note, this is a Duplicate: Anyway appears there have been quite a few changes between v3.1.3 and 4.0.0, as I also hit this one. The BarGraph specific logic in v3 of the library that shunted the viewport up and down half an xInterval, so you got a full width bar for the first and last entry on screen appears to have been dropped, but it's trivial to code around e.g.
double xInterval=1.0;
graphView.getViewport().setXAxisBoundsManual(true);
if (dataSeries instanceof BarGraphSeries ) {
// Shunt the viewport, per v3.1.3 to show the full width of the first and last bars.
graphView.getViewport().setMinX(dataSeries.getLowestValueX() - (xInterval/2.0));
graphView.getViewport().setMaxX(dataSeries.getHighestValueX() + (xInterval/2.0));
} else {
graphView.getViewport().setMinX(dataSeries.getLowestValueX() );
graphView.getViewport().setMaxX(dataSeries.getHighestValueX());
}

Related

AgGrid: fixed header with pinned bottom rows

I'm using ag-grid-community v.25.1.0 with 2-rows header and 5 pinned bottom rows.
I want the grid header to be always at fixed position - even when I scroll to the last data rows of my grid (which are often far below the screen bottom).
Unfortunately this forces me to set 'height = 100vh' for the grid - but then the 5 pinned bottom rows also occupy screen area, so there's too small height left for the data rows (about 10 data rows left when I'm using my 13-inch laptop). See demo #1 at https://codesandbox.io/s/aggrid-issue-demo-j9ls9
And if I do not limit grid height with 100vh - then the pinned bottom rows go ouside the screen together with the data rows (because AgGrid's OWN vertical scrollbar is no more shown) which is OK except for... scrolling down the vertical scrollbar of the grid's container (body tag) moves grid's header outside the screen (although "I want header to be always at fixed position" - see this requirement above!). See demo #2 at https://codesandbox.io/s/aggrid-issue-demo-2-52bo3 - it would be OK if header stayed at fixed position.
If there were no pinned bottom rows - the problem would not exist. But these pinned rows are really necessary in my app; however the fact that they occupy ~33% of the grid's height - is a real problem. Yes, I can make row height smaller (together with the font used to paint the cells) - but that's an ugly workaround, not a real solution. I can also provide users with a possibility to show/hide some of the pinned bottom rows (using several checkboxes) - but this "solution" also smells (besides, in most cases all 5 pinned rows are needed).
Is there any solution? maybe I can adjust header's CSS so that it's Y-coordinate stays strictly fixed? in such case removing 'height = 100vh' would solve my problem...
UPD: maybe it makes sense to describe the difference between demos #1 and #2:
App.css:
added this file to override the ".ag-root-wrapper-body.ag-layout-normal" style - because it had height set to zero
App.tsx:
added import for App.css (see above)
removed div style "height: '100vh'"
index.html:
removed body style "overflow-y: hidden;" (to enable vertical scrollbar which is needed to access last rows after we removed '100vh' above)

AgGridReact: Place horizontal scroll at bottom when using side bar

I'm looking for a way to pin/place the horizontal scroll at the bottom of the grid-area for the situation when the data-content (rows) are collectively shorter than the side bar height.
Example image
Example link
I can only see this problem when:
using grid options
sideBar={true}
domLayout={'autoHeight'}
there are too few rows

Unity list item is leaving extra space in high resolution

I have a vertical Scroll List. I have developed this app for resolution 768*1024. In this resolution my List is working fine. But when I run my app in higher resolution(1440*2960) it leave some space around all 4 direction.
I have also tried with changing Layout element min height dynamically, but Spacing issue is still exist.
Vertical and horizontal layout set element position in (screen width/height divided by a number of elements) * element number, in other words, they space out all elements evenly across canvas space. To achieve what you want you either have to enable child control size -> height option or write a script that aligns your elements in the center of the screen and one after another taking in consideration their height.

CodeMirror vertical offset at cursor

I have a CodeMirror window whose element's height is set to auto. The max height is set such that it does not add a scroll bar to the page itself. My problem is that when this max height is reached, any subsequent line additions is hidden until I scroll down manually. I would like additional lines to be shown when added by default, thus I'm looking for a vertical offset for the editor, similar to Vim's scrolloff. That is, I always want the lines above and below the cursor to be displayed.
I've come across cursorScrollMargin and played around with a few values, but no noticeable changes occur.

How to adjust multiple rows of labels in Xcode so that they occupy around 70 % of screen height?

I'm trying to build an app that has just a single portrait oriented view. There is a title on top and results label at the bottom of the view, these are locked to top and bottom and center, no problem here.
Now this is the tricky part. I have 9 rows of labels, most single row but couple span out to 2 rows. I want them to spread out evenly between the title and the result-label.
I lock the first label to top-left, lock the leading edges and then set equal vertical distance constraints between the labels. Otherwise ok but the last labels on 3.5 inch display overrun my results -label.
So I adjust either the fontsize or make vertical distance between labels smaller or both. 3.5 inch problem fixed but now there is a big empty gap between the last label and result. On iPhone 6 its really ugly.
I have tried all sorts of methods but can't just get this working.
So basically: how do I reserve 10 % of view height from top and 20 % from bottom and tell Xcode to use the rest 70 % (and all of it) for my 9 rows of label, evenly?
Thanks for help!
Would have posted an image but no rank for such things...
If I understand you right, you need several flexible spaces that will all be the same size. One space in-between each of the labels.
Create UIViews to put between each label, set them all to have equal widths or heights and anchor each one to the views it is supposed to sit between.
I got this idea from another SO question: Springs in Auto Layout: Distribute views evenly, with constraints, in Xcode 5