Iccube: Pie chart value of misc (other) - google-visualization

I am using a pie chart and have following problem:
There are many items which have a value less than 5 %.
Is there an option that those items will sum up to an item "misc".
On a different report it sums up to "misc" if the value is less than 0,1 %
It is possible to set that value?
Iccube Version 5.1.7
Cheers
J

You could combine small slices using the following configuration option:
https://developers.google.com/chart/interactive/docs/gallery/piechart#slice-visibility-threshold
To configure this in the reporting application v5.x use the advanced section of the chart configuration(Chart Edit -> Widget Tab -> Advanced Properties -> Extra Options)
:{
sliceVisibilityThreshold: 0.01,
pieResidueSliceLabel: 'Misc'
}
Example of the configuration:

Related

Google Sheets: Calculate the number of coloured cells IF the check box is marked

I am trying to calculate the number of coloured cells in a column where the check box is also marked.
For example, in column F, there are 2 green cells in rows with marked check boxes. I have failed to work out a formula that would help me do this. I am using the function by colour add-on to count number of coloured cells.
Any help would be greatly appreciated.
Sheet
Explanation:
I would use a custom function to do that and then use it as a formula in the sheet.
Please read more about custom functions and their limitations.
They are not refreshed as regular formulas but only when an argument changes. Please look online for workarounds on this issue if it is a bottleneck in your project.
Solution:
Click on Tools => Script editor on the top menu of the spreadsheet file, copy & paste the below code into a blank script and click on save.
function countColors(checkboxesColumn,colorColumn,hexCode) {
const ss = SpreadsheetApp.getActive();
const sh = ss.getActiveSheet();
const values = sh.getRange(checkboxesColumn).getValues().flat();
const colors = sh.getRange(colorColumn).getBackgrounds().flat();
return values.filter((v,i)=>v==true && colors[i]==hexCode).length;
}
then you can use that function in your sheet as =countColors("C3:C","F3:F","#b7e1cd"):

Simplest annotated line chart

this was originally asked on Google groups but since I received no replies, I'm asking here on SO.
I am plotting basic data like temperature, various counts and such with date time and I like to append a third column as a further description.
E.g.
time, value, description
time, value, description
time, value, description
So I am looking at the simplest way of plotting that, as full screen as possible, as minimally (least LOC) as possible.
So far with https://jsfiddle.net/kaihendry/q1mczqc1/2/ I have not figured how to show the description (is it a infobox/selection? not sure on terminology), which in my example is the kernel version, when I click a point.
Furthermore I don't understand why on the right of the graph there are these null value labels:
http://s.natalian.org/2015-06-16/1434449447_1054x1058.png
And any tips to make http://s.natalian.org/2015-06-16/foo.html scale to fill the whole screen? I especially want to make it usable on my iPhone.
I have not figured how to show the description (is it a infobox/selection? not sure on terminology)
In web development, this is called a tooltip. In Google charts, you can add a tooltip by replacing the commented line with the following one :
//data.addColumn('string', 'kernel');
data.addColumn({type: 'string', role: 'tooltip'});
So, the 3rd column will not be handled as a data series, but as a tooltip.
Furthermore I don't understand why on the right of the graph there are these null value labels
The null values are shown, because (as previously stated), you have inserted 2 series of data ('Date' and 'kernel'). If you make the replacement mentioned before, the null values will be replaced
And any tips to make .. scale to fill the whole screen ?
You can add the following option to configure the dimensions of the chart :
var options = {
chartArea: {width: '80%', height: '80%'}
};
Furthermore, since the version of line charts you are using are slightly obsolete, you shoud replace
var chart = new google.charts.Line(document.getElementById('linechart_material'));
with
var chart = new google.visualization.LineChart(document.getElementById('linechart_material'));
In the following jsfiddle, you can find a final working version
(with some more fixes, like horizontal axis range and legend positioning).
If I understand right you want to add third column as a description for each point.
If you add 3rd column like this
data.addColumn('string', 'kernel');
Google chart takes this as another series and because the data are string it can't draw the series and shows null.
You can add 3rd column as a tooltip.
data.addColumn({type: 'string', role: 'tooltip'});
But for tooltip to work you need to change the line chart to visualization line chart
var chart = new google.visualization.LineChart(document.getElementById('linechart_material'));
To make chart fill the screen you can change the div style.
<div id="linechart_material" style="height:100%;"></div>

predicting a numerical value using KNN in weka

I have two data sets, one for training and one for testing.
I am going to predict the values of a column with numerical type in test data set. In order to predict the value of an instance, I have to find the k nearest neighbors of that instance in training data set, and calculate the average of values. (waiting also can be used).
For example:
column0 column1 column2
......a..................b....................10
......a..................b....................12
......c..................d....................16
......a..................b....................?
I need a method of data mining to give me the result = (10+12)/2 = 11
Which method should I use to get such a result?
And do you know any good document which explains how to use that method?
KNN in Weka is implemented as IBk. It is capable of predicting numerical and nominal values.
If you are using the Weka Explorer (GUI) you can find it by looking for the "Choose" button under the Classify tab. Once there navigate the folders:
classifiers -> lazy -> IBk
Once you select IBk, click on the box immediately to the right of the button. This will open up a large number of options. If you then click on the button "More" in the options window, you will see all of the options explained. If you need more of an explanation of the classifier they even list the academic paper that the classifier is based on. You can do this for all of the classifiers to obtain additional information.

ScaleMin not working with cf chart in cf 9

I am creating a line graph chart in CF 9.
My cfchart code is below:
<cfchart showborder="yes"
chartheight="500" chartwidth="1000"
yaxistitle="% Correct" xaxistitle="Month"
sortXAxis="yes"
xAxistype="Scale"
showxgridlines="yes"
scaleFrom="1"
scaleTo="110"
showLegend="yes"
tipStyle="mouseOver"
title="Data Entry Audit %">
</cfchart>
Along the X-axis will display the Month Numbers, but it is counting by 2s, instead of 1,2,3,4,5,6 etc.. It is diplaying 0,2,4,6,8. There is data for month of January, so "1", but the 1 does not show up along the x-axis. I tried adding Scalemin=1 and ScaleMax=12, but it seems this is not supported with CF 9. Any help is much appreciated.
Thanks!
How many months are you displaying along the x-axis? Webcharts3D (the underlying charting tool) does a lot of automatic adjustments to ensure the best fit of chart elements. If Webcharts3D is skipping labels, then it may have decided there are too many to reasonably fit on along the axis. So it opts to display every other label instead.
I do not think cfchart has an attribute for overriding those particular settings on the x-axis. However, you can use the webcharts3d utility to customize/override the default settings. Specifically, play around with the xAxis settings in the "basic" tab (type, scale min/max, etcetera).

Google Charts Visualization Column Chart axis formatting and column colors

I have this Column Chart using Google's Visualization Chart API tools. How would I make it so the y-axis numbers are only positive whole numbers? I've tried looking through the documentation but can't seem to find anything.
I used the following and have not seen fractions since...
vAxis:{minValue:0,maxValue:5,gridlines:{count:6}}
The trick seems to be that with 6 gridlines and 5 as lowest 'high' value,
the halves and tenths aren't applicable anymore.
This worked for me
vAxis: {minValue:0, format:'#'}
Simply use hAxis.format
example :
hAxis: {minValue:0,format:'0'},
format 0 = Digit
Positive numbers:
You can use vAxis.minValue to set the lowest y-axis gridline, however the actual value of the gridline will be the minimum of what you set and the lowest value in your data, so if you have 0 in your data (as it seems you do for Unsatisfactory), this value will be used for the lowest y-axis gridline.
Whole numbers:
http://groups.google.com/group/google-visualization-api/browse_thread/thread/04a001766367dc0f/84c34338c2808069 - this is an older post, but as there is nothing in the chart API documentation, it seems the functionality to specify whole numbers only is still lacking.
Because the chart defaults to 5 gridlines (this is what you'd like to be able to override), if your highest data value is 2.0 (like in the example) you could force whole numbers by setting vAxis: {maxValue: 5}, although this may not be the most elegant solution.
you can use the axisLabels feature.
To use it, you must manually edit your axixLabels as shown here: http://code.google.com/apis/chart/image/docs/chart_params.html#axis_labels
e.g.:
chxt=x,y
chxp=0:|Excellent|Very Good|Fair|Unsatisfactory|1:|0|1|2
Greetings,
Jan
If you change your graph type as follow:
google.load('visualization', '1', {'packages':['linechart']});
will work for you..
var max=Math.max(1,10,15,20);(u have to pass the values what the values u have)
var maxvalue= max / 4;
var res=Math.floor(maxvalue);
res=res+1;
var remin= max % 4;
if(res != 0) {
maxvalue=(res * 4);
}
else
maxvalue= 4;
use the above code its working fine for me.
The only workaround that I could find to this problem is that... For example, the default grid divisions are 4. You could change that number. But incase of the default (4) the vAxis.maxValue should be divisible by 4, if now increment that number so that it is.