How to "disable" the word-wrap in the legend text of chart made with antV library? - reactjs

So I am working on front-end and I am using Ant design library for stacked area charts. Everything else is working quite perfect so far but the text in legend is bit long so it is getting wrapped with ellipsis by default. I have tried alot of options but nothing has worked so far. I want the legend to display all the text and disable word-wrap no matter how long the text is.
NOTE: This is my first ever question on stackoverflow so please feel free to ask for anything which I have missed to mention.

Related

QGIS doesn't make the correct legend with using color_rgb even though the colors in the polygons are correct

I'm working on my QGIS portfolio and doing some training with public geologic data. I used to use MapInfo and would use RGB fields, tie them to the polygons, and make the correct geologic colors. I'm trying this in QGIS and ran into a problem that was asked on StackOverflow years ago but not answered. When I use color_rgb("R", "G", "B") in a Category Symbology, I get the correct colors on the map but not in the legend it created. I've tried the RGB fields as Integer and Text and get the same result, the wrong colors in the legend. I heard that this was possibly a bug in the software and haven't found a work around yet. It would be a pain to have to make the legend manually, that was what the color_rgb was supposed to be for. Does anyone have any work arounds for this issue?

Vertical alignment of text and icon

Today I spent two hours trying to align vertically the text of a toogle button at the bottom of the button icon.
The button icon height is a three or four times longer than the text height: the text must be vertically aligned at the bottom of the icon.
The method setVerticalAlignment(int valign) works as expect if the parameter is Component.TOP or Component.CENTER, but Component.BOTTOM acts exactly as Component.CENTER.
I tried a lot of workarounds, without success. It’s odd that a so easy task is hard to do: am I missing something? Thank you.
I don’t know if it’s relevant, however I’m also using setTextPosition(Component.RIGHT).
Edited answer...
That code is a bit difficult to work with and has so many nuances and misbehavior's. I usually end up just splitting the text and icon to separate labels and using something like a flow layout:
Form hi = new Form("Big and Small", BoxLayout.y());
CheckBox toggle = CheckBox.createToggle("My Text");
toggle.setUIID("Label");
Label bigIcon = new Label("");
FontImage.setMaterialIcon(bigIcon, FontImage.MATERIAL_INFO, 10);
Container lead = FlowLayout.encloseBottomInRow(toggle, bigIcon);
lead.setUIID("ToggleButton");
lead.setLeadComponent(toggle);
hi.add(lead);
hi.show();
Note that at this time this code requires a change that was added yesterday to the code (the ByRow method). Initially I thought this was a bug in FlowLayout but it seems it was just two different ways of calculating vertical alignment for the container.
To get a sense of why aligning and placing labels is so hard check out this code responsible for that: https://github.com/codenameone/CodenameOne/blob/fd2acfc10eb22f4b7a3089aeac4e967280f92b4e/CodenameOne/src/com/codename1/ui/plaf/DefaultLookAndFeel.java#L1314-L1623
This is just the generic code. There are copies of it in native iOS and Android code (for performance).

Vertical column cursor highlighting in text editor?

I'm looking for a basic text editor or a plugin for an existing editor that can highlight the entire current column or vertical location of the cursor similar to the common option to highlight the entire currently selected row or line.
I think it would be very useful for indented code.
Does anyone know where I can find something like this?
I understand exactly what you're looking for and want it myself. I use Notepad++ (based on Scintilla) but there doesn't seem to be a "highlight current column" option the way they do provide for "highlight current line".
I looked at the plugin architecture and demo plugin package. I whipped up a proof of concept - very basic, surely buggy, that uses the long lines edge column indicator as the "highlight" for current cursor column. Not the best solution since if you're using the edge indicator, you "lose" it.
Source code on GitHub:
https://github.com/vinsworldcom/nppColHighlight
Notepad++
It's based on the Scintilla library which implements exactly that feature you're describing, basically highlighting a rectangular area.
To do so, hold Alt + Left Mouse or Alt + Shift + Arrow Keys to select.
If you still haven't found such an editor, PSPad editor has the feature.
Link: https://www.pspad.com/
Please see the attached screenshot (don't worry about the editor language in my screenshot, English (and several other languages) are also available).
PSPad editor with vertical line showing the current cursor position

Search for words like in chrome

this is how Chrome finds you a word when you search for it:
1) select it in all the places it appears.
2) draw little line in the scroll bar wherever it found the searched word.
I have a canvas with scroll view around it, and I want to perform the same thing on it.
I gues that for enabling the selection i'll have to use only richtextboxes ?!? (hope not).
any third party or idea or anything will be highly appreciated
Without looking directly at the Chormium Project (which is open source and available at Chormium Homepage) I would imaging what is happening on this particular example is something following these steps:
Word Highlighting
Search the page source/content for the keyword using a simple regex
Insert that text into some form of a HTML container (either a span or a div) with a particular id
Use CSS to style that container to indicated the highlighting
Sidebar Highlighting
Use some algorithmic method to vertical position of the highlighted term
Add a indicator to the side bar in a some presentation layer/control that is transparent and below the scroll bar
It may be possible that there exists a 3rd party control that does these things, or it may be possible to leverage your work off of the existing work in the chromium project. However it is most likely not done using a RichTextBoxes nor simple text selection.

Display percentage on piechart in WPF

Hii
Can anyone tell me how can I show percentage on the piechart....
The percentage is seen on mouseover event but I dont know how to show
the percentage on the piechart's slices....
If you are looking to put labels on the chart itself (instead of tooltip), take a look at this great blog post by WPF guru Bea Stollnitz.
It shows how to do this, in many different modes, and explains not only how, but why.
Take a look at amCharts Bundle for WPF. Pie chart supports labels on the slices, outside connected labels and includes an algorithm to prevent label overlapping.
I've just followed this tutorial (just to make sure) and I get the percentages of each slice as tooltip on mouse over by default.
If you post your code we might be able to spot if there's a problem with it.
You can use labelFunction in mx:PieSeries, and lableFunction look like that
private function pieSeries_labelFunc(item:Object, field:String, index:Number, percentValue:Number):String
{
return StringUtil.substitute("{0} ({1}%)",item.description,percentValue.toFixed(1));
}
Where description is the label that you want to see.
feel free to ask any question.

Resources