Remove value in circle Swiftcharts - swift

At the momtent I try to find out how I can make the table that I would need for my app. I would like to remove the value in the circles.
But now I came across the possibility during my search that it is possible to hide the value in the circle.
This should be possible with LineChartData.drawValuesEnabled = false. However, I can not find the same in the Swiftcharts code, so I wonder if this option has been removed or is it called / works differently?

Values should be removed from DataSet, not from LineChartData.
This code might help you.
let set1 = LineChartDataSet(entries: values)
set1.drawValuesEnabled = false

Related

Is it possible to count line shapes in a PDF page using iText 7

How to get the count of all line shapes created by PdfCanvas.stroke() method?
let pdfDictionary = pdfDocument.GetPage(1).GetPdfObject()
let foundObjects = pdfDictionary.GetAsDictionary(PdfName.???)
What 'PdfName' property should be used as a parameter? 'PdfName.Line' does not work.
Maybe I am looking wrong way.
EDIT:
Some PDF pages have one line and some three lines and it is the only one attribute for filtering documents. I need to filter documents by the count of these lines.
Maybe I have to find another way for achieving this goal.
By the way, lines are black and have fixed position and size. Maybe I should check the spot color at certain positions? If it is possible...
Thanks in advance.

How do i randomize between labels when button is pressed?

I'm pretty new to swift. The purpose of my app is to show different text on my labels when a button is pressed. I will have hundreds of labels so should i use some kind of a database. If so how can I randomize between these labels. Would be great if any of you could write that piece of code. I also need my app to remember the previous label, so that a user can go back when another button is pressed.
Here is how to generate a random number in Swift:
let rand = Int(arc4random_uniform(x))
This generates a random number between 0 and x-1.
Unfortunately, without a more detailed description and without your code, I can't answer anything more than that.
Create an array of all the possible labels, i.e.
let labels = ["Label1", "Label2", "Label3", "Label4"]
//add data to the labels
Use randomElement() on the labels array to get a randomLabel, i.e.
let randomLabel = labels.randomElement()
You can do create an Array with labels. For example:
let labels = ["Some Text","Some Text","Some Text"]
Then use randomElement() from labels array:
randomTextLabel.text = labels.randomElement()
You can also use json to store data. I dont know how, but you can always google!

cannot find css element in protractor

How do I locate the element with the following html, I have 4 Start buttons each in different color. I tried using css by class and is not working. There are no unique ids as well. Pls help
Start
As Ben Mohorc points out, you really need to give us a bit more to go on. But if you are saying there are multiple start buttons, but only one of each color, it ought to look like this. For now I assume all they say is "Start". If that is only part of what they say, use partial buttontext.If it is background color that differs, you may need to adapt that, too.
var coloredButton = element.all(by.buttonText('Start')).filter(function(elem) {
return elem.getCssValue('color').then(function(color) {
return (color == '#00ff00')//fill in the desired color here, in this format
})
});
Then do your stuff on coloredButton.first(), which will be the only one, according to what you are saying.
For more on the format to expect from the color, see http://www.protractortest.org/#/api?view=webdriver.WebElement.prototype.getCssValue

How to highlight first node of GtkTreeView

I would like to highlight the first node of a GtkTreeView and give that node the focus. gtk_tree_view_row_activated () seems appropriate for what I am trying to do, but I couldn't figure out the arguments it takes.
Thanks in advance.
gtk_tree_view_row_activated() actually acts on just one cell. I wonder if you really want to Highlight the row or just select it. I.e. if you want to leave the highlight even if the cursor is on another line.
If that's the case, note that you can define extra fields in the underlying model, for example, if you have 3 fields for your data, you can add field 4 with a color. Then you can tell the renderer to use the color in field 4 (instead of giving the renderer the color immediately).
This example not only changes the background, but also the text color:
http://faq.pygtk.org/index.py?req=show&file=faq13.031.htp
For more sophisticated work, you can even modify the atributes on a cell-per-cell basis:
http://www.pygtk.org/docs/pygtk/class-gtktreeviewcolumn.html#method-gtktreeviewcolumn--set-cell-data-func
Use set_cursor method:
TextView.set_cursor(0,None,False)
0 = Index of the first row

How to copy objects behaviors into another from the same type?

Is there any opportunity to copy objects behaviors to another?
e.g. I have an label "labelx" with the settings font size = 12 and color = blue
Now I want to pass this settings to another label "y".
Thanks in advance!
label2.font = label1.font;
label2.textColor = label1.textColor;
If you have a lot of this labels it would make sense to add them to
an array and "copy" the properties in an enumerated loop.
You might want to take a look at this answer - it shows a way of
deep-copying a label.