labels

Swift: expected declaration error setting “Label” to a string variable

邮差的信 提交于 2019-11-29 10:13:08
I am managing different languages, in a small single pane app, using a different string array for each comment, indexed by an integer variable "userLang", then setting label.text = array[index]. The basic code is: import UIKit class ViewController: UIViewController { var userLang = 0 var arrayOne = ["hi", "hola"] var arrayTwo = ["Bye", "Adios"] @IBOutlet weak var msgArrayOne: UILabel! @IBOutlet weak var msgArrayTwo: UILabel! msgArrayOne.text = arrayOne[userLang] //Error here: !Expected declaration msgArrayTwo.text = arrayTwo[userLang] //odd, but this line gets no error until I //remove the

How to limit d3.svg.axis to integer labels?

北战南征 提交于 2019-11-29 09:02:55
Is there any possibility to limit the number of d3.svg.axis integer labels displayed on the graph? Take for instance this graph. There are only 5 sizes here: [0, 1, 2, 3, 4] . However, the ticks are also displayed for .5, 1.5, 2.5 and 3.5 . You should be able to use d3.format instead of writing your own format function for this. d3.svg.axis() .tickFormat(d3.format("d")); You can also use tickFormat on your scale which the axis will automatically use by default. I've realised that it is enough to hide these values, rather than to completely exclude. This can be done using the tickFormat (https:

rotate X axis labels 45 degrees on grouped bar plot R

a 夏天 提交于 2019-11-29 06:55:54
How can I rotate the X axis labels 45 degrees on a grouped bar plot in R? I have tried the solution suggested here but got something very messy, the labels seem to have been added multiple times (only showing the axis part to protect data privacy): This solution (gridBase) was also unsuccessful for me, for some reason I get the following error: "Cannot pop the top-level viewport (grid and graphics output mixed?)" PS. Most people seem to recommend this solution in R base but I am stuck with that too because I don't understand what data they are referring to (I need some kind of example data set

HighCharts Pie Chart - Add text inside each slice

限于喜欢 提交于 2019-11-29 04:32:41
I am creating a financial pie chart using HighCharts that represents asset allocation. My goal is to create a chart that represents the actual allocation values in each slice but inside each slide will show essentially a second data label that displays the target percentage for various investment vehicles. It is important to note that the current asset allocation may not always match up with the targeted allocation value. I have gotten everything working except for the Target labels inside each slide. See the image below for what I would like to accomplish: Here is what I have thus far: var

CSS to align label and input

血红的双手。 提交于 2019-11-28 16:12:23
HTML Code Snippet: <fieldset id="o-bs-sum-buginfo"> <label for="o-bs-sum-bug-ErrorPrefix">Error Prefix</label> <input type="text" id="o-bs-sum-bug-ErrorPrefix" name="ErrorPrefix" value="" /> <label for="o-bs-sum-bug-ErrorNumber">Error Number</label> <input type="text" id="o-bs-sum-bug-ErrorNumber" name="ErrorNumber" value="" /> .... </fieldset> Using only CSS (or jquery), irrespective of the browser size, I want to pair label and input elements next to each other. I also do have freedom to change tweak the HTML. if required. Spudley This is one of those things which can be surprisingly tricky

Automatic adjustment of margins in horizontal bar chart

半腔热情 提交于 2019-11-28 07:42:57
I need to produce a series of horizontal grouped bar charts. The barplot function does not automatically adjust the margins of the plot, therefore the text gets cut off. graphics.off() # close graphics windows test <- matrix(c(55,65,30, 40,70,55,75,6,49,45,34,20), nrow =3 , ncol=4, byrow=TRUE, dimnames = list(c("Subgroup 1", "Subgroup 2", "Subgroup 3"), c( "Category 1 Long text", "Category 2 very Long text", "Category 3 short text", "Category 4 very short text" ))) barplot(test, las=2, beside = TRUE, legend=T, horiz=T) I can't find an option to automatically move the plot further to the right,

D3.js, force-graph, cannot display text/label of nodes

自作多情 提交于 2019-11-28 07:41:08
问题 I cannot display labels of nodes using a force-layout in d3.js. I'm trying with this example http://d3js.org/d3.v3.min.js I updated that code only adding zoom, like this: var svg = d3.select("body").append("svg").attr("width", width).attr("height", height).append('svg:g').call(d3.behavior.zoom().on("zoom", redraw)); function redraw() { console.log("here", d3.event.translate, d3.event.scale); svg.attr("transform", "translate(" + d3.event.translate + ")" + " scale(" + d3.event.scale + ")");

information from `label attribute` in R to `VARIABLE LABELS` in SPSS

本小妞迷上赌 提交于 2019-11-28 07:03:52
I'm working in R, but I need to deliver some data in SPSS format with both 'variable labels' and 'value labels' and I'm kinda stuck. I've added variable labels to my data using the Hmisc 's label function. This add the variable labels as a label attribute , which is handy when using describe() from the Hmisc package. The problem is that I cannot get the write.foreign() function, from the foreign package, to recognize these labels as variable labels. I imagine I need to modify write.foreign() to use the label attribute as variable label when writing the .sps file. I looked at the R list and at

Can an input field have two labels?

[亡魂溺海] 提交于 2019-11-28 05:35:44
Mary had a little form, and its fields where labeled just so. Whenever an error crept in, confusion it would sow. I've got a label for each input field... pretty standard affair. After validating the form, I'm displaying a helpful little paragraph at the top of the form detailing what information is missing or incorrect. Can I have two labels for the same input field? One in the form proper, and one in the validation reminder text? Is there any reason I shouldn't do this? I assume this question is about HTML forms. From the specification : The LABEL element may be used to attach information to

How to limit d3.svg.axis to integer labels?

爷,独闯天下 提交于 2019-11-28 02:24:56
问题 Is there any possibility to limit the number of d3.svg.axis integer labels displayed on the graph? Take for instance this graph. There are only 5 sizes here: [0, 1, 2, 3, 4] . However, the ticks are also displayed for .5, 1.5, 2.5 and 3.5 . 回答1: You should be able to use d3.format instead of writing your own format function for this. d3.svg.axis() .tickFormat(d3.format("d")); You can also use tickFormat on your scale which the axis will automatically use by default. 回答2: I've realised that it