Getting Data from JSON with anystock - anychart

Based on anychart doc, it is very straight forward to load data :
var json = { "chart": { "type": "pie" }}
anychart.fromJson(json);
Now I am trying to do the same with anystock... but cannot figure out how:
var json = { "chart": { "type": "stock" }}
anychart.fromJson(json);
I have the error below :
Unknown chart type: stock
I guess it is because anychart and anystock are 2 different products, but I cannot figure out what should be the correct configuration.

I just got an answer from anychart :
unfortunately AnyStock 8.0.1 of October 2017 doesn't provide this
feature. However in future releases this feature might be implemented.

Related

Date field not recognized with Azure Form Recognizer

I have built a custom neural model using the Form Recognizer Studio. I have marked the date fields when I labeled the data to build the model.
I have problems extracting the exact date value using the following Java SDK:
com.azure:azure-ai-formrecognizer:4.0.0-beta.5
The returned JSON (as previewed in the Form Recognizer Studio) is:
"Start Date": {
"type": "date",
"content": "01.05.2022",
"boundingRegions": [
{
"pageNumber": 1,
"polygon": [
1.6025,
4.0802,
2.148,
4.0802,
2.148,
4.1613,
1.6025,
4.1613
]
}
],
"confidence": 0.981,
"spans": [
{
"offset": 910,
"length": 10
}
]
}
If I am using the Java SDK, then the getValueDate() returns null, while the getContent() returns the correct string value.
Most likely the issue occurs because the document I use is not in English and the date format might not be recognized. As per documentation here: https://learn.microsoft.com/en-us/azure/applied-ai-services/form-recognizer/language-support only English is supported for custom neural models.

Drupal Services Plugin ignoring multi-value fields

I'm using drupal 7 with services plugin 3.17
I'm trying to create a node with a field that accepts multiple values via json api with the following data:
{
"type":"custom_type_article",
"title":"My title",
"language":"und",
"body": {
"und": [ { "value": "Article body" } ]
},
"field_article_auhtors": {
"und": [{"value": "author 1"}, {"value": "author 2"}, {"value": "author 3"}]
}
}
The node is succesfully created but only the first value of field_article_auhtors is populated.
Is my json structure incorrect to create multiple values on "field_article_auhtors"?
Version 3.17 of Services has a bug with multi value fields. It looks like the bug is a regression introduced around version v3.6.
A patch was released in November, and multiple users are reporting it as working, though officially it's marked as 'Needs Work'. (The author has asked for a review of the code, and it has already been included in the dev version of Services. That said, a gentle nudge / reminder to test it in a dev environment. ;)
See the conversation, the patch, and a dev release of Services that includes it over on Drupal's official Services Project section at https://www.drupal.org/project/services/issues/2224803

Voting tool with CouchDB and conflict issues

I'm building a very small app where the user chooses a category, then a logo from said category and submits a form.
The document with the categories and logos is a JSON, and I have a bit of experience with CouchDB, but I get the feeling that such an app is a revision conflict magnet, as it'd be difficult to keep track of different users using at the same time and trying to update the document with the same revision ID.
I haven't been able to find some code or idea dealing with this issue.
Here's how my JSON looks like:
$scope.categories = [
{
name: 'DIY',
logos : [
{
url:'img/...1.png',
votes:0
},
{
url:'img/...2.png',
votes:0
}
]
},
{
name: 'Food',
logos : [
{
url:'img/...1.png',
votes:0
},
{
url:'img/...2.png',
votes:0
},
...
Any idea on how to deal with such an issue?
Here's a live test version of the app.
It would be useful to understand the design of your app. If I were designing this, I think I would generate a new CouchDb document when the form is submitted to record each vote. This would avoid updating any shared document and any risk of conflicts. Showing the results would then be a map/reduce query on the "vote" documents.

How to traverse the following JSON in angularJS

So i am recieving a JSON string from a rest service which has the following structure-
{
"map": {
"Project [projectId=1, projectName=Project1]": [
{
"employeeId": 4,
"employeeName": "fourthEmployee"
}, {
"employeeId": 3,
"employeeName": "thirdEmployee"
}
],
"Project [projectId=2, projectName=Project2]": [
{
"employeeId": 4,
"employeeName": "fourthEmployee"
}
]
}
}
( for reference, this is the object type being made available by rest - Map<Project,List<Employee>>)
My question is, how do i display the data from this particular JSON onto the HTML page in the form of a table, using angularJS?
I do realise ng-repeat is to be used multiple times. Its just that using ng-repeat, i'm not able to get the values from JSON. Could someone reply with code, that would be really helpful thanks.
EDIT: As pointed out by Robert, the problem is i am unable to get values from the compound project data. Help is appreciated. Thanks.
Based on insufficient data let me provide a solution to the problem that I speculate OP is actually having.
Compound project data problem
I suspect that the main problem you're having is not about using nested ngRepeat but parsing the compound data of your projects.
This means that before you try displaying your data, you have to parse it or re-map it to something that you can actually use in your view.
This example uses regular expression to parse individual project property values.
var rx = /^Project \[projectId=(\d+), projectName=(.+)\]$/i;
var result = [];
for(var p in data.map)
{
if (data.map.hasOwnProperty(p) && rx.test(p))
{
var m = rx.exec(p);
result.push({
id: m[1],
name: m[2],
employees: data.map[p]
});
}
}
This is a working Fiddle with your provided data that displays projects including their data.

date of street view static image

I am using Google's Street View Static Image API. It works great, but I am wondering if it is possible to get meta data for the images I am saving, specifically the date. Is there anyway to know the date of the static image?
Thanks,
Lee
Yes, you can get the image date using the Google Maps Street View Service in JavaScript.
Briefly, you would need to go through the usual setup steps to get Google Maps working on your page, then you would do something akin to:
var sv = new google.maps.StreetViewService();
var berkeley = new google.maps.LatLng(37.869085,-122.254775);
sv.getPanoramaByLocation(berkeley, 50, function(data) {
console.log(data.imageDate);
});
data.imageDate will contain the date in YYYY-MM format.
You can use StreetViewService's both getPanoramaById and getPanoramaByLocation methods to obtain this data. Please see here.
var panoramaOptions = {
position: streetViewLocation,
pov: {
heading: 0,
pitch: 5,
zoom: 1
},
visible: true,
addressControl: false,
imageDateControl:true
};

Resources