chartjs unlimited x axis labels - chart.js

i have a chart that fills itself with values, however currently i am limited on how many values i can display by the amount of label values i insert.
$scope.AxirsLabels = [1,2,3,4,5,6,7,8,9,10];
for example with the above label value i can only display 10 different values on the chart.
is it possible to set an unlimited amount of values based on the values of data?
each data value is an integer like 10 or 20 etc.
everytime the user clicks a button values are added to the data of the chart and the X axis needs to adjust.

Fixed it by using the function i use for adding data to the chart for the label values as well. this adds label values based on the amount of data values there are.
$scope.AxirsLabels = getDataProp('values');

Related

chart js how do I only show just the low/high dots on line chart?

How do i only show data points for the low and high? Every other data point can be hovered over to get their value but by default just the low and high should always show with custom tooltip
I was able to find a solution in case this helps anyone else out.
as i generate my xData and yData from api, i then grab min/max value from array
then i loop thru yData array and pull out the index of the min/max
as i'm initializing line chart, i used a function for pointRadius in the datasets that sets the dot to 10 if it's low or high, if not set it to 0 so it doesn't show

Power BI: How to change the background color for specific rows in a matrix?

I want to change the background color for specific rows in a matrix based on the name of the row.
Here is my matrix
What I did so far was to create a conditional column X in the data table that says, for example, when asset_name is A82 give me 1, in all other cases give me 0. Then for each field in Values, I created a conditional rule based on that X column -
when column X is 1 - blue color, when is 0 - white color. Basically, I apply conditional background color for the columns. However, I want to be able to conditionally color the rows. There is no option to choose a background color for the fields in Rows. Therefore, I'm able to custom-color only the column part of the matrix.
Is there any workaround for this?
Could you use something like this - you can conditionally format a row based on the value of a measure https://www.cloudfronts.com/conditional-formatting-by-row-in-a-matrix/

Multivariable Power BI Scatterplot?

My question is similar to this question here:
https://community.powerbi.com/t5/Desktop/Multi-variable-Scatter-Plot/m-p/312013#M138304
I understand that you can only display one variable on the x-axis of a PowerBI scatterplot. But, I'm trying to figure out if there's a way to toggle on/off multiple variables on the scatterplot. For example, the Y-Axis wouldn't change, but you could add/remove different variables to display on the x-axis.
My variables are all in date format, so it would be great to overlay different variables on the x-axis, i.e. "event1", "event2", "event3", so that you could see them in relation to one another. Is this possible? PowerBI has virtually no documentation that I can find.
I'm not sure about multiple variables, but you can at least change the variable to display in the axis based on a slicer.
The steps:
Create 2 new tables, each representing the possible values on each axis (Just the labels and an index);
Create measures with the values you'll want to see in the axis (ex: Total Sales);
In each table, create a new Measure with a Switch that maps the labels to the created measures.
Ex:
Measure Selection I =
IF(ISCROSSFILTERED('Measure Selection I'[Measure I]);
SWITCH(
TRUE();
VALUES('Measure Selection I'[Measure I]) = "Danceability";[Total Danceability];
VALUES('Measure Selection I'[Measure I]) = "Energy";[Total Energy];
);
Blank())
Create the Visual and the slicers, and put the created measures in the corresponding places.
Here is a video with an example:
https://www.youtube.com/watch?v=gYbGNeYD4OY

Google Charts not displaying correctly

I am generating a URL that needs to create a PNG Graph, using Google Charts API.
I thought that I had all the parameters in the right position however the graph is not displaying correctly? It is only displaying one of the series, and even then, the series data is wrong.
If anyone can point me in the right direction, it would be much appreciated!
http://chart.apis.google.com/chart?
cht=lc&chs=800x350& // CHART SIZE
chco=6a6572,6a6572,6a6572,6a6572& // SERIES COLOURS
chxr=1,-11519.670000,19297.010000& // Y AXIS RANGE
chxt=x,y& // X & Y AXIS
chxl=0:|January%2017|February%2017|March%2017|April%2017|May%2017& // X AXIS VALUES
chdl=A|B|C|D& // SERIES NAMES
chtt=Sales+Year+To+DateYYYY& // CHART TITLE
chts=000000,24& // CHART COLOR AND FONT SIZE
chd=t:6032,13921,0,1263,19297|-1330,-11520,-4410,490,-361|298,798,285,228,108|884,1651,1161,1473,961
// SERIES VALUES
I finally figured it out. For some reason the series values parameters were taking a percentage value? So once I converted the values to a percentage of the total, it displayed fine.

Caffe: Multi-Label Images with Varying Number of Labels

I have a dataset where the images have VARYING number of labels. The number of labels is between 1 and 5. There are 100 classes.
After googling, it seems like HDF5 db with slice layer can deal with multiple labels, as in the following URL.
The only problem is that it supposes a fixed number of labels. Following this, I would have to create a 1x100 matrix, where entry value is 1 for the labeled classes, and 0 for non-label classes, as in the following definition:
layers {
name: "slice0"
type: SLICE
bottom: "label"
top: "label_matrix"
slice_param {
slice_dim: 1
slice_point: 100
}
}
where each image contains a a label looking like (1,0,0,...1,...0,....,0,1) where the vector size is 100 dimension.
Now, I apologize that my question becomes somehow vague, but is this a feasible idea? I.e., is there a better approach to this problem?
I get that you have 5 types of labels that are not always present for each data point. 1 of the 5 labels is for 100-way classification. Correct so far?
I would suggest always writing all 5 labels into your HDF5 and use a special value for when the label is missing. You can then use the missing_value option to skip computing the loss for that layer for that iteration. Using it requires add loss_param{ ignore_label = Y } to the loss layer in your network prototxt definition where Y is a scalar.
The backpropagated error will only be a function of labels that are present. If input X does not have a valid value for a label, the network will still produce an estimate for that label. But it will not be penalized for it. The output is produced without any effect on how the weights are updated in that iteration. Only outputs for non-missing labels contribute to the error signal and the weight gradients.
It seems that only the Accuracy and SoftmaxWithLossLayer layers support missing_values.
Each label is a 1x5 matrix. The first entry can be for the 100-way classification (e.g. [0-99]) and entries 2:5 have scalars that reflect the values that the other labels can take. The order of the columns is the same for all entries in your dataset. A missing label is marked by a special value of your choosing. This special value has to lie outside the set of valid label values. This will depend on what those labels represent. If a label value of -1 never occurs you can use this to flag a missing label.