I am using jfreecharts to vreate a value-time chart.
Data is gathered dynamically from web services and some times there are large numbers in it. The chart is created without any problem but the value axis
labels are of this format: 2E10 etc. I would like to have 20000000000 displayed. I have not find any solution after 2 hours of rsearching. Can anyone suggest something?
This fixed the problem:
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
DecimalFormat newFormat = new DecimalFormat("0.0000");
rangeAxis.setNumberFormatOverride(newFormat);
It also works when you have a dataset with largest value a float with 0 as integer part and at least the first 3 decimal digits to be 0 in which case labels also appear in negative power of 10 by default.
Related
I am using rmarkdown to create a document. I want all numbers to have two decimals except for the whole numbers where I don´t want any decimal point. I am using the following commands:
knitr::knit_hooks$set(inline = function(x) {
prettyNum(x, big.mark=",")
})
options(scipen=1, digits=2)
However, when I have a number like 60.9785 it shows only 60. And if I change for digits=3, a number like 1.2644 it´s displayed like 1.264. How can I solve this?
I'm trying to convert my Klipfolio expression into a Google Data Studio chart expression for CTR Lift. CTR Lift is the percentage of difference each grouped result has from the minimum result. The expression is as follows:
&Column: CTR / REPEAT(MIN(&Column: CTR), COUNT(&Column: CTR)) - 1
I'm trying to recreate this as a chart field (it cannot be recreated as a data source field), but there's no "Difference from min" option:
Only percent/difference/percent difference from max is available, no min option:
How can I made Google Data Studio compare to min, instead of comparing to max?
I've tried things like 100 - AVG(CTR) or AVG(CTR) * -1, but they don't seem to match my Klipfolio data.
It turns out that AVG(CTR) * -1 is the correct syntax to compare to minimum, but I had to select, "Percent difference from max / Relative to corresponding data". The data set that I was comparing to to validate was inaccurate.
My line chart is not updating with new data once I click the black button and I'm not sure what I could possibly be doing wrong.
Block here:
Let's look at your NaN errors:
<path class="line" d="M0,324.19471776281716L0,NaNL155,NaNL155,270L310,270L310,353.84774728120146L465,353.84774728120146" transform="translate(78.1818,0)"></path>
Seems that we are missing two y values, we can see this if we split the path data into its x,y pairs:
M0,324.19471776281716
L0,NaN
L155,NaN
L155,270
L310,270
L310,353.84774728120146
L465,353.84774728120146
So, we need to check two things, one is the y scale, and the other is the data used in the y scale. The y scale looks ok, if it failed on one number it should fail on all numbers. Let's look at the csv data:
education,number
Bachelor's degree,2367
Degree in medicine, dentistry, veterinary medicine or optometry,5763
Earned doctorate,3862
Master's degree,1549
Here's our problem: we have a comma separated file type with lots of extra commas on the second row (not counting the column headers). We can see that is causing issues with the name of the second column in the alternate data: "Degree in medicine", the portion of the name beyond the comma is dropped. Let's entomb that data with quotations so that the commas won't count as delimiters:
education,number
Bachelor's degree,2367
"Degree in medicine, dentistry, veterinary medicine or optometry",5763
Earned doctorate,3862
Master's degree,1549
You're code in your update function is selecting #body when #body (id="body") doesn't seem to exist. Could you be meaning to use body instead to select the html body?
I have a formula which is simply 28742.92 / 100.
I have rounding which is set to 0.00001 however it outputs the value 284.
Is it possible to output decimal values as it appears in a standard calculation e.g. 28742.92 / 100 = 284.7289
Many Thanks.
Right click on your numeric field and choose the 4th option from the top Customize field.
Once done, choose the way you want to format your number
I'd like to calculate the standard deviation over two fields from the same dataset.
example:
MyFields1 = 10, 10
MyFields2 = 20
What I want now, is the standard deviation for (10,10,20), the expected result is 4.7
In SSRS I'd like to have something like this:
=StDevP(Fields!MyField1.Value + Fields!MyField2.Value)
Unfortunately this isn't possible, since (Fields!MyField1.Value + Fields!MyField2.Value) returns a single value and not a list of values. Is there no way to combine two fields from the same dataset into some kind of temporary dataset?
The only solutions I have are:
To create a new Dataset that contains all values from both fields. But this is very annoying because I need about twenty of those and I have six report parameters that need to filter every query. => It's probably getting very slow and annoying to maintain.
Write the formula by hand. But I don't really know how yet. StDevP is not that trivial to me. This is how I did it with Avg which is mathematically simpler:
=(SUM(Fields!MyField1.Value)+SUM(Fields!MyField2.Value))/2
found here: http://social.msdn.microsoft.com/Forums/is/sqlreportingservices/thread/7ff43716-2529-4240-a84d-42ada929020e
Btw. I know that it's odd to make such a calculation, but this is what my customer wants and I have to deliver somehow.
Thanks for any help.
CTDevP is standard deviation.
Such expression works fine for me
=StDevP(Fields!MyField1.Value + Fields!MyField2.Value) but it's deviation from one value (Fields!MyField1.Value + Fields!MyField2.Value) which is always 0.
you can look here for formula:
standard deviation (wiki)
I believe that you need to calculate this for some group (or full dataset), to do this you need set in the CTDevP your scope:
=StDevP(Fields!MyField1.Value + Fields!MyField2.Value, "MyDataSet1")