infinity load X item than use button - infinite-scroll

Is there a way to set X number of items to be load with infinity scroll and ten use load next button?
Or, as a more simple alternative, to just limit the number of total items.

Related

add values next to percentage of total in Tableau

I am new user of Tableau and I have a question:
How can I present both the values and the percentage of total in stacked column in tableau?
here is example how it should look like (i know how to do it in excel but not in Tableau):
Just add both values to label. After you compute the percent of total on SUM(Teus) hold down control to make a copy and drag it to Label to explicitly have it displayed. Then drag a new SUM(Teus) from the data pane onto Label as well. Now you will be able to see both values. You can then click on the Label button and then the [...] button if you want to customize how these values are displayed. Side note: you are getting those skinny bars because you have Year as a continuous dimension. Using it as a discrete dimension will give you the thick bars.

increase gap between bars in multi category groups

current imageI want to increase gap between bars in my SSRS bar chart after every group is finished (e.g. after every month). I have 2 category groups month and level. in each month there are 3 levels and I want to increase gap after 3 columns.
can you please help me?increase gap
There does not appear to be a way to increase the gap. However, there are two 'solutions'.
1. Go to the Chart Series Properties -> General -> Custom Attributes, and reduce the point width, perhaps from 0.8 to 0.6. Have a little play until you find something you like.
2. SSRS: Custom bar width between multi-level categories Try something like this. Add a dummy group to your dataset that has no value and turn the labels off.
I would go for number 1 as it is much simpler.

uicontrol slider type min max sliderstep

I am trying to add a scrollbar (a slider) to a fixed-height figure. There is a panel inside the figure and on the panel, there are multiple plots. The panel is longer in Y direction than that of the figure so that the slider will be necessary to see the hidden plots. I've created it and it is sort of working: showing the plots as the slider moves up and down.
The reason why I said "sort of" is because I couldn't understand the slider behavior with respect to its Min, Max, and SliderStep.
What I want to do is as follows:
Say I have 10 plots
The figure height allows only 6 to be shown (plot 1 through 6)
I want the slider size to be 6/10 of the figure height
So that it only takes one click (down arrow) to see the rest of the plots, but this time plots 5 through 10 will be shown
If I have 18 plots, then it should take two down-arrow clicks to see the last set of 6 figures and the slider size should be 1/3 of the figure height
I searched and searched for hours today, but I couldn't even find a good documentation on how to use Min and Max in conjunction with SliderStep. All I could find was a comment that says "if you play enough with them, you'll get the size the way you want". So, I played with them for another hours, but its behavior just doesn't make sense.

How to fix the number of rows while designing pdf using iText in java

I am creating one pdf file showing a list of all employees and their salaries. At the end of the page it is showing the total of all salaries.
I am using a for loop to add multiple rows to table.
The problem is:
at the end the row, the total salary doesn't fit on the same page and it is shown on the next page.
So is there any way that I can calculate the height of the page and then fix the height of each cell? And then accordingly, limit the number of rows.
So that at the end of the page, I can show the total number of rows and further record from next page.
Calculate the height of the page: well... you decide on the size of the page when you create a Document object. You can choose any size you want.
Calculate the height of a PdfPTable: that's explained in chapter 4 of my book. When you create a PdfPTable, you add PdfPCell objects to an object that only exists in memory and that doesn't know anything about page size. By default, the width is expressed as a percentage of the available width of the page to which you'll add the PdfPTable. Only when you add the PdfPTable to a specific Document, the exact width and the height will be calculated (which is too late for you).
If you want to know the height in advance, you need to define an absolute width (not a percentage). Tables with the same content and a different width will have a different height. Defining an absolute width is done like this:
table.setTotalWidth(width);
table.setLockedWidth(true);
In this snippet (taken from the TableHeight example), width equals the width of the page minus the left and right margin. You're defining the width of the page and the margins upon creation of the Document object. By default, the page size is A4, so the default width is 595 user units and the default margins are 36 user units.
So, one way to solve your problem, would be to add rows in a loop and calculate the height of each row with the getRowHeight() method or the height of the complete table with the getTotalHeight() method (both methods will return 0 if you omit setting the total height). If you see there's not enough space to add the summary row, you can use the deleteLastRow() method to remove that last row and to create it anew in a new table on the next page.
That's one solution. Another solution could be to use table and cell events, but that's more difficult to explain.

How to make a table view which can be scrolled for ever?

I have a set of 100 rows, pretty similar to values which can be selected in a picker. When the user scrolls the table, I want the rows to be appended like an forever-ongoing assembly-belt. So when the user scrolls down and reaches the row 100, and scrolls even further, the table view will show again row 1, and so on. Reverse direction same thing.
My thoughts:
don't display scroll indicators (they would make not much sense, probably)
what value to return in the numberOfRows delegate method? This infinity constant?
in cellForRowAtIndexPath: simply wrap the index around when it exceeds bounds?
Many apps do this. The idea is that the beginning of the table is always the same, but you keep adding to the end, so the table just keeps growing.
Let's say you first have 100 data elements. Your numberOfRows returns 101 then. First 100 cells are normal. And scroll indicators still make sense.
If the 101st cell is displayed, you display a progress indicator like UIActivityIndicator in the cell, and initiate the process to load next 100 rows. When the data arrives, you either reload the whole table with UITableView reloadData, or you insert new cells individually with UITableView insertRowsAtIndexPaths:withRowAnimation:.
So, you just keep infinitely appending to the table. This is easier than trying to keep the table as a "window" that is always at N cells/rows and unload from the beginning of the table. If you need this sort of window, you may reconsider if this is really the best way to interact with your data.
I just finished implementing a variation of this.
Lets assume you have a 100 rows and 8 of them fit in a screen. Start by adding the last 8 rows first, then the 100 rows normally and then the first 8 rows at the end. Recenter the tableview by using setContentOffset to the first row of the 100.
When the user scrolls below the 100th one he will see rows 1-8, you can detect this in the viewDidScroll delegate function and recenter the scroll back to the first record (ensure u set the animated flag to NO when you do this). Similarly when the user scrolls past 1, he/she will see the last 8 records, you can again recenter the scroll view to show the last 8 records in the 100 row section.
This actually implements circular scrolling and the user can keep scrolling in both directions.
I haven't tried this but here's an idea. Let's say N = 100, since you have 100 rows. What we'll do is tell the tableview we have 200 rows, but we'll keep the user scrolling in the range 50-150.
Tell (the tableview) that you have double that number of rows, so for numberOfRows, return 2*N. In cellForRowAtIndexPath, always return the cell corresponding to (row % N).
Now init the table scrolled to row N (instead of 0) so that the user can scroll in either direction.
As the user scrolls up the tableview will eventually ask for row N+(N/2), when that happens send a scrollToRowAtIndexPath:atScrollPositionanimated: to scroll to the row-N. That will reposition the table back by N (ie: from 150 to 50), same cell but we'll never run off the end of the table this way.
Do the same when the tableview asks for cell at row N-(N/2) for scrolling up.
You'll have to deal with the special case where N cells fits in the view with extra room, ie: what if N were 1?