I want to ajust 3 gauge boxes on the same row using shiny app.
I am trying to use the following example: Fluid Grid System
However, all my attempts had no success on this C3 gauge box.
fluidRow(column(width =8, box( C3GaugeOutput("gauge1","auto","auto")),
box(C3GaugeOutput("gauge2","auto","auto")),
box(C3GaugeOutput("gauge3","auto","auto"))))
I have tried to modify the width and height arguments, besides, column size per line, but the results remains the same.
I could solve modifying the function into:
fluidRow(column(4,box(width = 15,C3GaugeOutput("gauge1","auto","auto"))),
column(4,box(width = 15,C3GaugeOutput("gauge2","auto","auto"))),
column(4,box(width = 15,C3GaugeOutput("gauge3","auto","auto"))))
Related
Using Bootstrap Grid Layout to show various forms. Cells are assigned width (e.g. 3 of 12 columns) and all of it is configurable. The problem is Label and Field width are supposed to be configured separately. E.g. labelA is width 2, fieldA is width 4, labelB is width 2, fieldB is width 4. This way user will see "2 column" layout: labelA-fieldA-labelB-fieldB.
However there's a problem if user decides to set label and field width to some other value, for example to span all row. User sets label B width to 4 and field B width to 8 expecting it to take whole row. However, in this case he'll get labelA-fieldA-labelB-[empty space for 2 columns] on the first row and fieldB on the second row. Obviously the intended solution would to have labelA-fieldA-[empty space for 6 columns], then labelB-fieldB on the next row. Again, this is all configurable so I need solution for all cases.
A perfect solution would be to have some way to force those cells (label and field) to be non-breakable. Can't find the way to do that.
Another way would be to create a container component with width=label.width+field.width. But then I'll have problems with setting label and field width inside of those containers because I can only set label/field width relative to direct parent and I need to set width relative to the parent's parent. I've heard there are ways to change number of columns in component on render and it'd work if I set number of columns to label.width+field.width. But as far as I understand it's a dirty solution.
The code is in React and this is what's generated for each label and field. InpComp may be any component, doesn't matter in the end. labelWidth and fieldWidth are set by configuration.
const labelWidth = this.getLabelWidthFromConfiguration();
const fieldWidth = this.getFieldWidthFromConfiguration();
return (
<div className={'component-container'}>
<div className={'col-md-${labelWidth}'}><b>{this.field.attributes.label}</b></div>
<div className={'col-md-${fieldWidth}'}>
<InpComp />
</div>
</div>);
What can I do to this code so that those label and field always end up on the same row?
what about an if-statement? ;)
you can do something like this:
if (lableWidth + fieldWidth !== 6) {
fieldWidth = 12 - lableWitdh;
}
This solution only works for one case (LA+FA = LB+FB = 6). You could set a condition for each case by your own using if/else or switch-case.
Like Troyer said, we're not here to show ideas or do your work, we are here to fix code problems. Next time you should try to solve your Problem by your own until you get in stuck and then provide your Code.
I have a range bar chart inside a table of row group and the chart is repeatedly generated according to a category. I want to increase chart height dynamically based on a category.
suppose
if category =A THEN CHART HEIGHT=10CM
if category =B THEN CHART HEIGHT=7CM
If you look in the Properties of the chart there is a field called DynamicHeight, which will, as suggested, dynamically change the height of the chart based on a value.
For example I have set a parameter called Offset to default to 8.
You can then set the value of DynamicHeight to
=CStr(Parameters!Offset.Value) + "cm"
Then, as you change the Offset parameter, the width of the chart changes.
DynamicHeight = 8
and
DynamicHeight = 4
Now how you calculate the height to be a meaningful and consistent is up to you... I get the impression you wouldn't want to use a parameter like the example above, but I'm sure it would be possible to create a calculation that will give you a sensible layout.
Update
Note it is not possible to alter the DynamicHeight on a table that is recreated multiple times in a Matrix.
I believe this is because the size of the chart area is determined to generate the layout of the report, and this area is then populated with the actual chart later in the rendering process. It doesn't know until the later stage that is should be a smaller size, so therefore is not the smaller size.
I have built a "gantt" style range chart in SSRS using Narayana Palla's model. I am using date parameters to view the data by a date range - my dataset is museum exhibitions over a number of years. I have opted to use the DrawSideBySide = false custom attribute to display series data but I can not position the series labels as I want. I want them to align left however they align right and overlap with each other. I have tried many different combinations of properties including the smartlabel properties but can not impact on the position of the labels in the series. I have not been able to find a solution in my searching.
I would be happy to have my series displayed using DrawSideBySide = true but the bars are so narrow that neither they nor their labels can be seen. Again I have tried many combinations of properties to set the width of the bars but to no avail. I believe this is due to the number or series in the whole of my chart / dataset.
I would like advice on :
1. How to adjust the position of the labels in the series OR
2. How to fix the width of the series bars so that I can see them on my chart OR
3. If I am right about the size of the data set making the bars miniscule how can I best resolve this - say group on year so that only a limited (and therefore hopefully wide) set of series bars appear at a time from page to page.
Very grateful for any assistance, Sally
In SSRS, for the label overlapping issues, the only way is manually changing the chart area size to make enough space for those labels. Otherwise we have change an appropriate chart type.
I have an annoying problem with Matlab coding: I have created a uitable which store values and I have implemented a function for highlight the number in cells in particular conditions. This has been done giving an html command, the problem is that after the setting of new colour the number from a "double" becomes a "cell" and updating the data in the table it highlights correctly the value, but aligns all the numbers to the left; instead I would like to keep them constantly on the right. I tried everything without positive results; I think is enough to add the alignment command in the html syntax, but somebody can give me some suggestion?
This is the part of the code:
tab = findobj('Tag',tab_name);
valrow = cellstr(num2str(tab.Data(index,1))); %number in the cell has to be highligthed
color = [1 1 0.4]; %yellow
clr = dec2hex(round(color*255),2)'; clr = ['#';clr(:)]';
valrow = strcat(...
['<html><body bgcolor="' clr '"text="#010101; font-weight: width=100px">'],...
valrow); %html code for highlight the number
fulltab = cellstr(num2str(tab.Data(:,1))); %transform all the data in the table from double to cell
fulltab(index,1) = valrow; % switch the old value in the tab with the same value highligthed
set(tab,'Data',[fulltab]);
As I said previously, this code works but put all the data in the table from right usual alignment to the left.
I had the same problem... then I realized the width was set at 100% not the actual cell width. Once I made the correction the text was aligned within the width setting.
CellVal = strcat('',MaxOver,'');
I'm working with PyQt and I was wondering if there is any way to set a grid layout in a window so that, for example, one button's geometry wouldn't be affected by the configuration of the layout - because I'm trying to have my button in a square shape and, with the grid layout, it always becomes a long rectangle.
Also, I have multiple rows and columns, and to edit each minimum size would be horrifying. So, is there is any way to establish the geometry of a widget in a grid layout?
UPDATE: my grid
self.Grid = QtGui.QGridLayout()
self.Grid.addWidget(self.Button1,0,0)
self.Grid.addWidget(self.Box1,2,1)
self.Grid.addWidget(self.Box2,2,3)
self.Grid.addWidget(self.Button2,0,4,Qt.AlignRight)
self.Grid.setRowMinimumHeight(1,50)
self.Grid.setRowMinimumHeight(1,50)
self.Grid.setRowMinimumHeight(3,250)
self.Grid.setColumnMinimumWidth(0,100)
self.Grid.setColumnMinimumWidth(2,50)
self.Grid.setColumnMinimumWidth(4,100)
self.setLayout(self.Grid)
Given the example code in your question, just add something like the following:
self.Button1.setMinimumSize(50, 50)
self.Button1.setMaximumSize(50, 50)
or:
self.Button1.setFixedSize(50, 50)