Get Highchart (/ Highstock) from public data (json) - highcharts

Here's an example how to plot the chart with json data
Is there a way to chart this from public data (meaning any listed company)? For example from bloomberg data? https://www.bloomberg.com/markets/chart/data/1D/AAPL:US
I guess the format is just wrong?

For Highcharts the structure of data is important, not the source. All you should do is set the correct link and series data, but unfortunately I see a problem with CORS: How does Access-Control-Allow-Origin header work?
series: [{
data: data.data_values,
...
}]
Live demo: http://jsfiddle.net/BlackLabel/5u0jv31y/

Related

Is it possible to use the offline export in stockchart?

Or there is another option for client export without using highcharts servers.
Yes, exporting and offline-exporting also work for Highstock. Example:
Highcharts.stockChart('container', {
exporting: {
fallbackToExportServer: false
},
...
});
Live demo: http://jsfiddle.net/BlackLabel/7j50fwtd/
Docs: https://www.highcharts.com/docs/export-module/client-side-export

Google docs api insert column break

How to insert column break using google docs api v1? There are methods like insertPageBreak and insertSectionBreak but nothing for column break.
Unfortunately, what you want cannot be achieved.
When updating a Google Doc, the only options are indeed only the ones to insert a page break or a section break.
However, the ParagraphElement contains a ColumnBreak element. So when creating a document using the below request, you can specify directly where you would like to place the ColumnBreak
Request
POST https://docs.googleapis.com/v1/documents
Body
"paragraph": {
"elements": [{
"startIndex": start_index,
"endIndex": end_index,
"columnBreak": {
"textStyle": {}
}
}]
}
What you can do in this situation is to file a request on Google's Issue Tracker here and provide all the necessary details.
Reference
Google Docs API batch.Update;
Google Docs API ParagraphElement;
Google Docs API documents.create.

How to remove Dynamics 365 finance & operation metadata from odata call?

I try to get data from OData.
The link is as below.
https://*********.cloudax.dynamics.com/data/PurchaseOrderHeadersV2?$select=PurchaseOrderNumber,RequestedDeliveryDate,DeliveryAddressDescription&$filter=OrderVendorAccountNumber%20eq%20%27100001%27
I only add 3 fields to the select clause. But the "#odata.etag" field has added to the response. The response is as below.
{
"#odata.context":"https://****.cloudax.dynamics.com/data/$metadata#PurchaseOrderHeadersV2(PurchaseOrderNumber,RequestedDeliveryDate,DeliveryAddressDescription)","value":[
{
"#odata.etag":"W/\"JzE5MDYyOTE2NzcsNTYzNzMwMzU3NjswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn\"","PurchaseOrderNumber":"PO00003871","RequestedDeliveryDate":"2020-10-07T12:00:00Z","DeliveryAddressDescription":"******"
},{
"#odata.etag":"W/\"JzE5NjkzNDMzOTUsNTYzNzMwMzU3NzswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn\"","PurchaseOrderNumber":"PO00003872","RequestedDeliveryDate":"2020-09-16T12:00:00Z","DeliveryAddressDescription":"*******"
},{
"#odata.etag":"W/\"JzIwNzgyNTg4OSw1NjM3MzAzNTc4OzAsMDsxLDU2MzcxNjMzMjY7MCwwOzAsMCc=\"","PurchaseOrderNumber":"PO00003873","RequestedDeliveryDate":"2020-10-08T12:00:00Z","DeliveryAddressDescription":"*****"
},{
"#odata.etag":"W/\"JzE3MjYzMjQ0NzUsNTYzNzMwMzU3OTswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn\"","PurchaseOrderNumber":"PO00003874","RequestedDeliveryDate":"2020-10-08T12:00:00Z","DeliveryAddressDescription":"**********"
},{
"#odata.etag":"W/\"JzEsNTYzNzMwNDMyNjswLDA7MSw1NjM3MTYzMzI2OzAsMDswLDAn\"","PurchaseOrderNumber":"PO00003881","RequestedDeliveryDate":"2020-10-09T12:00:00Z","DeliveryAddressDescription":"*********"
}
]
}
How can I remove this metadata information from response?
You can try these headers, which will eliminate metadata from response.
Content-Type: application/json; odata.metadata=minimal
In fact you can mention odata.metadata=none for further
apiurl?$format=application/json;odata.metadata=none

Google Docs API : How to update alignment of the table?

I have a Table in the google docs and want to change its alignment to -0.71 but i do not see any Python API to change table properties. This can be done easily using following UI on google UI (as shown below):
I also tries looking at following requests but could not find it:
updateTableColumnProperties
updateTableCellStyle
For debugging, i created a doc with mentioned alignment and tried dumping JSON of it. But i do not see alignment keyword in the JSON.
Thanks #jescanellas for reply.
I found a hack, this may not be the best solution but works.
1) Update paragraph style and set the indentation, alignment as required. Here the start_idx is the index where table needs to be created.
request = [{
'updateParagraphStyle': {
'paragraphStyle': {
'namedStyleType': 'HEADING_5',
'direction': 'LEFT_TO_RIGHT',
'alignment': 'START',
'indentFirstLine': {
'magnitude': -51.839999999999996,
'unit': 'PT'
},
'indentStart': {
'magnitude': -51.839999999999996,
'unit': 'PT'
},
},
'fields': '*',
'range': {
'startIndex': start_idx,
'endIndex': end_idx
}
}
}]
2) Create the table, it will get created at new indented place.
request = [{
'insertTable': {
'rows': 1,
'columns': 1,
'location': {
'segmentId':'',
'index': start_idx
}
},
}]
It's not currently possible to do so. You can create a Feature Request for the Docs API, and you can also subscribe to this one for Apps Script by clicking on the star next to the Issue number to give more priority to the request and to receive updates.
In case of the second request being implemented, you could call the script from the command line using Clasp.

Using a geojson with highmaps

I want to display some data about San Francisco using highmaps but there is no maps of the different neighborhoods in SF in the highmaps library so I found an geojson of San Francisco wich was validate by this site: geojson validator but when I use the highmaps validator he doesn't read it: the highmap validator
$('#run').click(function () {
var geojson = $.parseJSON($('#geojson').val());
// Initiate the chart
$('#container').slideDown().highcharts('Map', {
series: [{
mapData: geojson
}]
});
});
This is my geojson: pastebin code.
Do you know why it's not validated by highmaps but it's validate by the geojson validator? Or do you know a San Francisco map which will be validated by highmaps?
Consider importing your .geojson into QGis, then exporting it out again. In my experience any .geojson that QGis produces is usable by Highmaps. Also see this tutorial Creating custom geojson maps for Highmaps with QGis.

Resources