I'm using the highcharts heatmap to display fixed interval data, sometimes with 24, 48 or 96 values in a day.
On the y axis I don't want to display each time depending on the interval, this would clutter the y axis.
How can I hardcode arbitrary labels along the extent of the y axis. I want 24:00 at the top, 00:00 at the bottom, and 06:00, 12:00, 18:00 evenly spaced out in between?
24:00 |
......... |
......... |
18:00 |
......... |
......... |
12:00 |
......... |
......... |
06:00 |
......... |
......... |
00:00 |
I don't think what I've asked for is possible, so I ended up computing a suitable tickInterval elsewhere to pass into the chart
Related
I want to have a stacked column chart with one column of data with 4 items. Each item has two measures associated with it, say a percentage of total and a dollar value.
For example,
Item % $
A 42% $15.00
B 33% $12.00
C 14% $5.00
D 11% $4.00
Is it possible to show the 4 items in a stacked column, with each item appearing once. The chart's left axis would have percentage labels (totaling 100%) and the right axis would have dollar labels (totaling $36).
Google Sheets question.
I have the following sheet which can grow by adding both rows and columns. The first cell of added columns can be either red or blue, randomly:
MonthYear | red | blue | blue | red
Jan/2017 | 100 | 200 | 10 | 20
Feb/2017 | 800 | 900 | 50 | 60
The result I need should hold the sum for each color:
MonthYear | red | blue
Jan/2017 | 120 | 210
Feb/2017 | 860 | 950
How can I do this with formulas that update the result automatically when adding new rows/columns in the data sheet?
Thanks a bunch!
Single formula solution, paste the formula into another sheet:
={FILTER(Sheet1!A:A,Sheet1!A:A<>""),{TRANSPOSE(UNIQUE(TRANSPOSE(FILTER(Sheet1!B1:1,Sheet1!B1:1<>""))));MMULT(ARRAYFORMULA(OFFSET(Sheet1!B2,,,COUNTA(Sheet1!A2:A),COUNTA(Sheet1!B1:1))*1),ArrayFormula(--(TRANSPOSE(UNIQUE(TRANSPOSE(FILTER(Sheet1!B1:1,Sheet1!B1:1<>""))))=TRANSPOSE(FILTER(Sheet1!B1:1,Sheet1!B1:1<>"")))))}}
I've made a Sample sheet with solution and explanation.
I set up an example sheet that produces this output:
https://docs.google.com/spreadsheets/d/1xex8ptlabXsclb5fJFO5pG78_EQPAJ65xxpNHDhshoU/edit?usp=sharing
The formulae used are:
cell A1: =ArrayFormula(Sheet1!A:A)
cell B1: =TRANSPOSE(UNIQUE(TRANSPOSE(Sheet1!B1:1)))
cell B2: =SUM(QUERY(TRANSPOSE(QUERY({Sheet1!$A$2:$A,FILTER(Sheet1!$A$2:$Z,Sheet1!$1:$1=B$1)},"where Col1= date '"&TEXT($A2,"yyyy-mm-dd")&"'",0)),,1))
The B2 formula is then copied to the rest of the B2:C3 range
I am trying to have custom formula for conditional formatting, but it doesnt seem to work with the 2 conditions...:
Columns TS Time
Row1 Y 80
Row2 N 85
Row3 Y 60
Row4 N 4
Column 'Time' --> Should be
Red if Time >= 80 and TS = 'N'
Orange if Time >= 80 and TS = 'Y'
Yellow if Time< 80 and Time > 24 --> This works
Green if Time <= 24 --> This works
You can do this with the conditional formatting, set the range to be applied to for the column you want highlighted, choose custom formula and add each one of these as it's own rule:
For orange:
=if(and(C:C>=80,B:B=""Y""),true,false)
and for red:
=if(and(C:C>=80,B:B=""N""),true,false)
I have a UITableView. Each row contains a UIView that contains two UILabels. The vertical spacing between the two UIlabels is specified with an auto layout constraint. It looks like this:
+-------------------+
| +----------+ |
| | +------+ | |
| | | text | | |
| | +------+ | |
| | | ROW |
| | +------+ | |
| | | text | | |
| | +------+ | |
| +----------+ |
+-------------------+
This usually works but sometimes the cell is rendered without space between the UILabels. When it doesn't work no error is printed. It seems non deterministic. I.e. if I create two cells with the exact same contents one might be rendered with the correct vertical spacing and the other without the spacing.
If you have any advice on how to figure out the problem please let me know.
Right now the table uses estimated row heights which seems a little flaky.
tableView.estimatedRowHeight = 100;
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewAutomaticDimension;
}
I run into the same problem occasionally.
When the result of UITableViewAutomaticDimension is near to the value of estimatedRowHeight,ten to one this problem will appear.
So I set the value of estimatedRowHeight to an impossible low value,such as 2,to work around,and it works fine.
So I'm plotting on an XY graph time along the x-axis and what I'd really like is for the axis labels to format themselves based on the range. (EG a small range would give hours, larger range could be days, years etc)
So something like 8 AM | 9 AM | .... | 11 PM
then NOV | 2 NOV | 3 NOV | ... | 30 NOV |
then 2001 | 2002 | 2003 | ..... | 2020|
etc. Can CorePlot do this for me? I know http://d3js.org/ can do it for my web friends.
Use a plot space delegate to monitor changes to the plot space. -plotSpace:didChangePlotRangeForCoordinate: is a good method for this purpose. After each change, check the current value of the plot range for the changed coordinate (x or y) and update the axis labels appropriately. When the plot range crosses a transition threshold, update the labelFormatter and other axis properties. Which ones need updates will depend on the labeling policy in use and the desired appearance.