Crosses instead of circles on GoogleChart - google-visualization

It is possible to display crosses on google chart instead of circles?
I cannot find it in the documentation.

The new pointShape option does not support crosses per say, but you can make the "star" shape look like a cross:
pointShape: {
type: 'star',
sides: 4,
inset: 0.1,
rotation: 45
},
pointSize: 16
Load the release candidate version (1.1) instead of the production version (1) to test this. This should be available in the next public release, tentatively scheduled for March 13, 2014.

Related

How to limit number of displayed points in chart.js?

I have too many points on x-axis in my chart. I would like to limit maximum of displayed points to 100. But at the same time still displaying same chart. Exactly same chart - but with fewer points.
screenshot of my chart with too many points
I have no idea how to do it in PHP at server side so I was thinking if there is any solution on client side in chart.js?
It's your responsibility to give chart.js the points it should display. You have to limit the arrays with the labels and the data to 100 datapoints. Use every second data or so. Just do it in plain JavaScript. There's no function in chart.js for that.
For large datasets, chart.js does offer a data decimation plugin that automatically decimates data at the start of the chart lifecycle, reducing the number of data points drawn.
According to chart.js docs, to use the decimation plugin, the following requirements must be met:
The dataset must have an indexAxis of 'x' The dataset must be a line
The X axis for the dataset must be either a 'linear' or 'time' type axis
Data must not need parsing, i.e. parsing must be false
The dataset object must be mutable. The plugin stores the original data
as dataset._data and then defines a new data property on the dataset.
Your chart options should look something like this:
options: {
parsing: false,
plugins: {
decimation: {
enabled: false,
algorithm: 'min-max',
},
},
scales: {
x: {
type: 'time',
ticks: {
source: 'auto',
autoSkip: true,
}
}
}
Remember also that if you disable parsing the data you pass should be in the right format for the type of chart you chose, so epoch timestamps in this case. More info here.
Finally, you can find a working example here.

Annotation value 21 found in labels. This is greater than number of classes

from the item it seems to be a pretty obvious issue right?
But for the life of me I swear I have 21 labels and 21 classes.
So just as a sanity check I thought i'd ask!
I have a load of training images (640,640)
I've gone through them and used DataTurks to annotate the data.
From that I've created a set of PNG masks where I've used 255 for blank space then tan Int for the corresponding number to make an NP array to then convert to a png.
I've then followed this sagemaker example for segmentation which seems to work until I run ss_model.fit.
This is where I start to get some errors. The full log can be seen in this Gist
The first error to jump out at me is:
label maps not provided, using defaults.
Which is strange as I believe I've loaded them correctly in S3 <bucket>/label_map/train_label_map.json
That label map looks like so : Gist (Perhaps it fails as it's not valid JSON however I was copying how another sagemaker example uses it?)
The second error to jump out is the one in the title.
Now it could be that my masks are competely wrong (I'm still very new to ML) but them look like this but 640x640:
[
255, 255, 255
255, 2, 2,
255, 2, 2
]
Where 255 is null and 2 is the annotation.
Could this error be because I'm not including the 255: "null" in the label_map ?
Any insight would be really helpful! Thanks.
-- But for the life of me I swear I have 21 labels and 21 classes.
If you have 21 classes, the maximum label should be 20 and not 21, therefore the error is thrown. Label indices start at 0. Notes for this can be found at the documentation page.
From your comment on your post, it seems like you have 23 classes if you have to set number of classes to 22. num_classes is only for classes and does not include the 255 or hole class. Note that the algorithm will work with no error if you give num_classes > you number of labels. This is because the num_classes parameter is used to create the softmax layer. If you have a num_classes more than the actual number of labels seen, some labels are simply not learnt.
Diving a little deeper, the label map in the link that you shared is wrong. Label maps only accept ints and not strings. Its an int-int mapping.
Following on, it is not simply enough to have the label_map in the S3 bucket, it needs to provided as a data channel into the algorithm while creating the training job.

Chart.js 2.0.0-beta2 disable points on line Charts

Is it possible to disable point display on 2.0.0-beta2 line type charts?
How?
I have a weekly graph with time scale where data is hourly. All works well but there are too many points. I would prefer a graph with just lines and without points. I searched the documentation but I haven't seen any option about it.
Maybe a bit late but still.
I had this same issue & searched the Source code for this (Because It used to be: pointDot: false which isn't working anymore)
There are 2 ways of doing this now:
Use the options (This is in the documentation nnick.github Chartjs & Search for point.radius)
options: {
elements: { point: { radius: 1, hitRadius: 1, hoverRadius: 4 } }
}
Use the property from the line dataset itself
data: {
datasets: [{
radius: 0,
Small remark: when using radius: 0 it's hard to find the point when mouseover

Two plus Two Poker hand evaluator: How are the cards mapped to the integers?

In an effort to create the fastest possible monte carlo texas hold'em hand analyzer with C++, I am currently looking into the subject of hand evaluation.
As many of you may know, there are quite a number of hand evaluators, open source, out there. After giving it some thought, I settled on the "Two Plus Two hand evaluator" (so named since it was first introduced on the two plus two forum).
This is one of the fastest known evaluators out there, and uses array lookups to quickly find the value of a hand.
Now, for the function, you need to pass in an array with the cards you are interested in. Example:
int Cards[] = { 3, 5, 10, 17, 23, 24, 32 };
int hv = HandValue(Cards);
With values between 1 and 52. Now, my question is: What cards do these integers correspond to? Is a 3 an ace of spades? A three of hearts? I have scoured google, the two + two forum, various pages where hand evaluators are presented, the source file for the build-up of the array. All in vain. So I am hoping that someone here can point me in the right direction of where I can find this information, or give it to me outright.
The source where the evaluators are taken from is this excellent article: http://www.codingthewheel.com/archives/poker-hand-evaluator-roundup#cactus_kev
Which explains all the evaluators individually.
I didn't verify this, but it appears to be:
"2c": 1,
"2d": 2,
"2h": 3,
"2s": 4,
"3c": 5,
"3d": 6,
...
"kh": 47,
"ks": 48,
"ac": 49,
"ad": 50,
"ah": 51,
"as": 52
ref: https://github.com/chenosaurus/poker-evaluator/blob/master/lib/PokerEvaluator.js

Cant understand the format of django.VERSION :-/

What does this mean? 1.0 or 1.1 ?
>>> django.VERSION
(1, 1, 1, 'final', 0)
Apologies for such a dumb question!
Is a tuple with the following fields:
"major"
The major version number of the Django release, e.g., 1 for the
1.x releases.
"minor"
The minor version number of the Django release, e.g., 0 for the
1.0.x releases, 1 for the 1.1.x release, etc.
"micro"
The micro version number of the Django release, e.g., 1 for a
release number 1.0.1, 2 for a release number 1.0.2, etc.
"release level"
A short string describing the type of release. Value will be one
of: "alpha", "beta", "rc" (for release candidates, "final".
"serial"
For situations where we do more than one release of a given level,
the incremental number of the release (e.g., 1 for "alpha 1", 3
for "beta 3", etc.).