I've searched through the entire AMCharts 4 bullet documentation as well as numerous Google pages, but I am yet to find the answer. When chart is squeezed to a mobile screen, bullet labels above bars get updated to some complete gibberish (as in the example below left). Those are suppose to be various numeric values (example on the right), including some with a decimal point. No percentage or other symbols.
The text actually gets swapped from normal numbers to the 'processed food' as the screen is being resized. Logic dictates that I must be missing some setting that prevents this sort of undesirable behaviour.
Any help is highly appreciated!
The "gibberish" is supposed to be an ellipsis. It's likely that your page isn't encoded to UTF-8 or the font you're using does not have the Unicode character for an ellipsis.
You can either double-check your encoding, or, if you don't want the ellipsis as at all, disable truncate on your labels. Assuming you're using a LabelBullet for your column labels:
var valueLabel = series.bullets.push(new am4charts.LabelBullet());
// ...
valueLabel.label.truncate = false;
For me the only way to get it show properly was setting value as workingValue
var bullet = series.bullets.push(new am4charts.LabelBullet());
bullet.label.text = "{valueY.workingValue.formatNumber('#')}";
bullet.label.truncate = false;
Related
I am working on conversion of pdf in to ZPL. I am using zebra programming language(zpl).
I am trying to control the barcode(any barcode) width using By command.
^By4 is giving lower width and ^By5 is going out of the box.
My use case is I want to achieve narrow bar width in float number(here 4.5). We can not pass float number in By command.
Please let me know if we can achieve this using some other method in ZPL.
You don't mention what barcode format you're using. Some of them, like 2of5, can also accept the ratio parameter for ^BY. The default is ^BY2,3, changing that to ^BY2,2 can make a smaller version:
^XA
^POI
^CFO,20
^BY5,3
^FO100,400
^BJN,100,Y,N
^FD200940^FS
^BY5,2
^FO100,700
^BJN,100,Y,N
^FD200940^FS
^XZ
This generates two barcodes in 2of5, one with the default ratio and one with a smaller ratio. The second one has a tighter barcode that uses less space. Valid values are 2.0-3.0 (although many round off to the same values) so there is some flexibility. Please note, this only works with barcode formats that are not fixed ratio formats.
You can check the manual page for ^BY in the ZPL programmers guide, p123, for the table that shows valid values and which ones round off to the same value (ie, 2.0 and 2.1 give the same results)
I am trying to right justify a bar code I am printing using ZPL from a .Net program. Here is my current code:
^FO10,50^FB500,1,0,R,0^AO,40,40^BY3^BCN,100,Y,N,N^FD1234567^FS^XZ
The Field Block seems to be ignored when working with a bar code, but for text it justifies it correctly. Any ideas?
Newer Zebra firmware supports a third parameter on ^FO and ^FT. If you want to right justify something, specify the right edge as the x parameter, and include a 1 as the third parameter.
^XA
^BY3
^FO85,30^GB500,450,3^FS
^FO100,50^BCN,30,Y,N,N
^FD>;12345678^FS
^FO100,120N^BCN,30,Y,N,N
^FD>;123456^FS
^FO100,190^BCN,30,Y,N,N
^FD>;1234^FS
^FO570,260,1^BCN,30,Y,N,N
^FD>;12345678^FS
^FO570,330,1^BCN,30,Y,N,N
^FD>;123456^FS
^FO570,400,1^BY3^BCN,30,Y,N,N
^FD>;1234^FS
^XZ
We had the same issue at our company. The barcode doesn't respond to the Field Block. Based on your example since you are using ZPL commands directly to generate your barcode (as opposed to an image of a barcode), you could do something similar to how we did. We know roughly how wide the barcode is going to be based on the data we write to it. So we created a method to determine the x-axis location of the barcode based on our also known label widths.
For example: We use the s4M printers and estimate the full label width to be about 780 dots wide. So in order to left/center/right justify, we take the rough barcode (estimated) width and calculate accordingly (left is set to xaxis = 0, center is set to xaxis = ((780 - barcodeWidth) / 2), and right justified would be xaxis = (780 - barcodeWidth). It isn't a perfect solution but is very close at least for our needs. You could certainly be more precise in your algorithm by looking at more barcode setting information like the data square size, columns, rows, etc... depending on your needs.
If you were to come up with a solution of generating an image of a barcode (which is what we are also trying to come up with now) then you should be able to easily get the width of the barcode image using build in .net graphics functionality.
I have a Text View box and I want that rectangle to stay the same size while the text inside autoshrinks to fit the box. The reason I need this is because the text is pulled from a plist and the strings are all different lengths. Labels have an Autoshrink feature which is exactly what I want, but I can't figure out a way even through code to get a Text View to do the same thing. Please help!
UILabels can have more than one line of text. You just need to set the following:
label.lineBreakMode = UILineBreakModeWordWrap;
label.numberOfLines = 0; // 0 = unlimited number of lines, set to another number to have that as maximum
I'm not entirely sure if this works, but you can then combine this with label.adjustsFontSizeToFitWidth = YES; to have a multi-line label that autoshrinks text.
Using the stacked area chart as seen in this example
http://nvd3.com/ghpages/stackedArea.html
Trying to format the y-axis tick labels and the tooltip labels to be integers instead of floats. Tried changing the follow code from
chart.yAxis
.axisLabel('Users')
.tickFormat(d3.format(',.2f'));
to
chart.yAxis
.axisLabel('Users')
.tickFormat(d3.format(',.0d'));
Precision remains unchanged (still shows values to the hundredths place). I've followed the Github Wiki to no avail https://github.com/mbostock/d3/wiki/Formatting#wiki-d3_format
Any suggestions or hints will be greatly appreciated.
Looks like this isn't supported by nvd3 at the moment. See the offending line.
In addition, your format specification isn't quite right. As mentioned in the documentation, "d" ignores non-integer values. So you probably want ",.0f" instead, which means:
,: use commas to separate thousands.
.0: precision of zero (the exact meaning of this depends on which type is in use).
f: The type; in this case, Number.toFixed. This means a fixed number of digits (the precision) appear after the decimal point, and the number is rounded if necessary.
this one can format label text from float to integer.
for pie chart:
chart.pie.valueFormat(d3.format(',.0d'));
for line chart:
chart.yAxisTickFormat(d3.format(',.0d'));
The .tickFormat method on the .yAxis method doesn't update it properly. This is the work around I used:
chart.yAxisTickFormat(d3.format(',.0d'));
I have tried like this
.axisLabel('%').tickFormat(function(d) { return parseFloat(d).toFixed(1) + "%"; });
Its working for me.I am getting results with decimal points and percentage.
I'm using iTextSharp to fill in some stamper AcroFields.
stamper.AcroFields.SetField("Title", "Lipsum");
I created the pdf in illustrator and the form fields with Adobe Acrobat X Pro. The problem is that although the text fields are the width of the page, in the saved pdf the text wraps at about 1 third of the width.
Another question would be if it's possible the have the textfield autoSize in height, or a way to handle the overflow of the text.
1) I'd like to see that PDF. I suspect the fields aren't as wide as you think they are.
2) You can set a field's font size to zero to enable "auto sizing", which works both within Reader and iText. However, it sizes to the actual field size, not what you think it might be.
I'm guessing you drew a spiffy form field background in Illustrator, then put a field over it in Acrobat Pro, but didn't size the field width to match the spiffy illustrator background. Could be wrong, but that's my hunch.
That's the flattened PDF. Can I see the original with the form field still intact? Sorry I wasn't more specific. None the less, I can learn a little from reading this PDF:
Looking at the bounding boxes for the flattened field XObject and it's internal clipping rectangle, it looks like it should be using most of the page:
The page is ~600 points wide by ~850 tall.
The flattened field XObject is ~560 points wide by ~100 tall.
I wonder if there's some non-standard carriage return characters in your text that iText picks up on by Acrobat does not...
Anyway, I'd like to see the unflattened PDF. Filled in is good, but not flattened.
Okay, looked at the template. I don't see anything that would cause the line breaking you're seeing... which makes me think my second guess was right: new line characters.
Looking at the text layout code might give me a hint. Each of your lines of text goes like this (for example):
1 0 0 1 2 88.24 Tm 0 g (Die Semmerrolle der l{e4}nge nach zu einer grossen Roulade)Tj
n n n n n n Tm: text matrix
g: gray (0 g: black)
(...)Tj: show text
That's consistent with the code path when you set a text field value in the trunk of iText (and the most recent release[s]). That code (ColumnText) is quite good at breaking text properly, and used all over the place. The bounding box is correct (as shown in a couple places of the flattened PDF).
Check your input.