Eliding of text when multiple lines in qml - c++

I have a text which is displayed in multiple lines and I need elide to happen for a line when the width of the text is exceeded.
Please find the code below that I have now.
Code:
Text {
width: 500
maximumLineCount: 3
horizontalAlignment: "AlignHCenter"
wrapMode: Text.WordWrap//"WordWrap"
elide:Text.ElideRight
text:"Firstline\nstart_kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk_end"
color: "red"
}
Now for me on line 1: "First line" appears and on 2nd line the remaining text appears without any eliding effect(i.e complete text is shown).
It appears the following way:
"Firstline
start_kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk_end"
I want eliding to happen at 2nd line as it exceeds the width.
Thanks in advance

According to documentation:
If this property is set to Text.ElideRight, it can be used with
wrapped text. The text will only elide if maximumLineCount, or height
has been set. If both maximumLineCount and height are set,
maximumLineCount will apply unless the lines do not fit in the height
allowed.
So the text will elide either if you add second line before, like:
text: "First line \nSecond line \nkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"
or
if maximumLineCount will be set to 2 lines:
maximumLineCount: 2

Related

Spacing changes when using xaringan with ninjutsu and going from a list with one bullet point to two bullet points

I am trying to create a complex incremental slide in Rmarkdown using the xaringan with ninjutsu for column formatting. I cannot (to my knowledge) use the standard approaches to incremental slides as elements are changing in multiple places (e.g., more text on the left hand column and an image that changes in the right hand column). Instead, I am recreating the entire slide each time. The problem I am having is that bullet lists change formatting as I go from one bullet point to two (even if I do not have multiple columns). Specifically, the spacing from text to bullets increases when I add a bullet point.
A simple document to reproduce the problem is:
---
title: "Test of bullet alignment"
output:
xaringan::moon_reader:
css: ["default", "ninjutsu"]
---
- A test
---
- A test
- B test
After knitting this document, when you go from the 1st to the 2nd slide the spacing from the bullet point to the text changes. This causes a noticeable change in the word wrapping that makes the slide look non-incremental.
Does anyone understand what is going on and have a solution or workaround?
You have such inconsistent space because you are adding extra space between two bullet points, which leads to wrap the texts A test and B test with paragraph html element p and ninjutsu.css contains the following line for styling the paragraph element.
.content > h1, h2, h3, p { padding-left: 2%;padding-right: 2%; }
So when you are writing a single bullet point, that is not getting wrapped with p but in the next slide when you are writing two bullet points with an extra space between them they are getting wrapped with p and therefore, getting 2% left and right padding. And hence the problem.
But in default xaringan (in default.css) there's no such style rule for paragraph elements in slide content class. That's why, in the base case, there's no such space inconsistency.
Solution
Now a possible solution could be to overwrite the css rule for p elements inside the list elements li and write your own rule for the desired padding (vertical and horizontal), which will work for both the below cases,
- A test
- B test
Or
- A test
- B test
Rmarkdown file
---
title: "Test of bullet alignment"
output:
xaringan::moon_reader:
css: ["default", "ninjutsu"]
---
```{css, echo=FALSE}
li p {
display: inline !important;
padding: 0px !important;
}
li {
padding: 6px 3px;
}
```
### This is non tight list (with space between items)
- A test
---
###This is non tight list (with space between items)
- A test
- B test
---
### This is tight list (with no space between items)
- A test
---
### This is tight list (with no space between items)
- A test
- B test

Change rowheight of Apex Interactive grid

In my application I need to set the rows to show the text area columns in more than one line (say 3 lines). However I don't want the text area column contents in one single line, despite the row height is increased. It should be wrapped to the number of lines.
If I turnoff fixed rowheight attribute. Then each row has a different height. Thats not what I'm expecting
I tried below inline css, but it is not changing
#static_id .a-GV-cell {<br/> height: 80px;<br/>}<br/>.wrap-cell {<br/> max-height: 64px;<br/> white-space: normal;<br/> overflow: hidden;<br/>
However this still only shows the text area column contents in one single line, despite the row height is increased.
thanks in advance

Coloring a table in apache superset

I want to color the background bars (or the entire cells) of the table as shown in the appended screenshot based on the "Group-By"/dimension value (red for "rot", yellow for "gelb" and green for "grĂ¼n").
I was able to color the metric-part of other visualizations with label_colors, but I have not yet found a way to color the cells of the table based on a "dimension".
Is there a way to do this?
As of now:
EDIT: I wanted to color it the following way (edited with paint):
This is a tad hacky, but you can add a markdown component and add the following markup:
<style>
th {
color: red; /* or whatever color/hex code you want */
}
</style>
The markdown component will be blank after you add this--i.e. there will just be a blank markdown block-- so you may want to add some copy. Alternatively, if you already have a markdown block, you can add it there, and it won't appear as long as you remember the <style></style> tags.

Data Preperation Identify String using Regex and move to new column

Hello I am using Talend to prepare product data for import into DB. I want to use the extract string parts function for Talend.
I have the following data in one cell. (The length of the data varies not a fixed width format)
Measurement: Ring Head Width: 6.8 Ring Height: 5.5 Ring Shank Width: 1.1 Ladies Band Width: 2.5 Ladies band shank Width: 1.2
I need help creating a regex format to match each measurement value and extract it to a new column.
What would be Regex to match the following text ?
Ring Head Width: 6.8
and extract the numeric value following it, which is
6.8
Similarly I want to create regex for all the above measurements. I am assuming the format will be the same.
Thank for your time and help.
If you don't bother using multiple actions to acheive this result I suggest that you use:
the "Split text in parts" action on ":"
and then use "remove whitespaces" to have a clean value.
If you really need to keep one action, you have the "Remove part of the text" action on regex that is based on the java Pattern.
Using regex ".*:\s" works fine

MSChart HowTo Create a Second CursorX to have multiple Cursor by a second Transparant ChartArea?

I am try to introduce a Second CursorX at AxisX Primary if this is possible some how?
I did try to activate a second CursorX at Secondary but that one did not work as expected,
I also readed about Line Annotation and Vertical Line Annotation and created some kind of line but a Second set of CursorX CursorY would be far nicer
I did try to create and as much as empty as possible and Transparant Second ChartArea which i try to overlay on top of the ChartArea1, i noticed InnerPlotPosition and Postion of both ChartArea should stay in track to get a full aligned Overlay, and next the CursorX of second ChartArea should be displayed on top of ChartArea1
This is what i think how it could be done but don't have a clue if it sounda for a good way to create a second CursorX maybe Line Annotation is an easier road to rome
Any help suggestion are welcome
Thanks in advance
Suppose your chart contains multiple chart areas aligned vertically, below code allows you set CursorX in each chart area:
Dim c1 As New Chart
'...here code block to build each chart area ...
'...then use below sample code to align each chart area vertically:
'c1.ChartAreas(i).AlignmentOrientation = AreaAlignmentOrientations.Vertical
'c1.ChartAreas(i).AlignWithChartArea = c1.ChartAreas(0).Name
'below set horizontal cursor (it is a gold vertical bar in each chart area):
For Each area As ChartArea In c1.ChartAreas
area.CursorX.LineColor = Color.Gold
area.CursorX.LineWidth = 3
area.CursorX.IsUserEnabled = True
area.CursorX.IsUserSelectionEnabled = True
area.CursorX.SelectionColor = System.Drawing.Color.PaleGoldenrod
Next