Is it possible to use the offline export in stockchart? - highcharts

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

Related

Highcharts credits link not working when exporting as PDF

When I set the credits.href option for a Highcharts chart, everything works well in the browser. The credits text is a clickable link.
However, if the chart is exported as a PDF, the credits text is not a link.
Here is my code:
let exportOptions = {
filename: filename,
fallbackToExportServer: false,
type: 'application/pdf'
};
let chartOptions= {
credits: {
enabled: true,
href: "http://example.com",
text: "TEMA-Q GmbH"
}
}
chart.exportChartLocal(exportOptions, chartOptions);
Am I doing something wrong or are credit urls simply not exported to PDF?
I am afraid that this functionality has not been implemented yet. I reported this idea on the Highcharts Github issue channel where you can follow and vote up this thread.
Link: https://github.com/highcharts/highcharts/issues/13594

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.

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

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/

HighCharts Editor Plugin Example not working

So I have the jquery-simple-rest plugin for Highcharts, (same used in the example documentation). I've linked the js file, and am not getting any errors in my browser. The documentation mentions also needing to the highed.use.
//The installer
highed.plugins.editor.install("jquery-simple-rest",{
//Contains information about the plugin - optional
meta:{
version:"1.0.0",
author:"Highsoft",
homepage:"https://github.com/highcharts/highcharts-editor/plugins/jquery-simple-rest.js"
},
//Add additional external dependencies here
dependencies:[
"https://code.jquery.com/jquery-3.1.0.min.js"
],
//This is the prototype options which the plugin accepts
options:{
url:{
required:!0,
type:"string"}
},
//Called when the chart changes
chartchange:function(e,t)
{jQuery.ajax({
url:t.url,
data:e.json,
dataType:"json",
type:"post"
,success:function(){
highed.snackBar("CHART SAVED")
},
error:function(e,t){
highed.snackBar("unable to save chart: "+t)
}
})
}
});
highed.plugins.editor.use('jquery-simple-rest', {options:{
url:{
required:!0,
type:"string"}
},
}
);
I can not get this plugin to appear in my the editor, and have no idea what it is I'm doing wrong.
link to example: https://github.com/highcharts/highcharts-editor/wiki/Plugins

JqGrid : File Upload not working

I am trying to upload file with jqgrid, but the is some mistake in my code.
I am using onInitializeForm method.
I am using Jquery Ajax File Uploader
Can anyone do help to me?
You can see Error in screenshot
This is my code.
jQuery("#formGrid").jqGrid(
{
url:'application/ajax/common_form_detail.php?form_id='+form_id,
editurl:'application/ajax/common_form_edit.php?form_id='+form_id,
datatype: "json",
colNames:[<?php echo $strfield; ?>],
colModel:[<?php echo $strFieldModel; ?>],
rowNum:20,
rowList:[20,50,100],
pager: '#formControl',
sortname: 'id',
viewrecords: true,
sortorder: "asc",
autowidth: true,
height: 400,
width: 900
});
jQuery("#formGrid").jqGrid('navGrid','#formControl',
{ edit:true,add:true,del:true,search:false},
{width:780,recreateForm:true},
{width:780,recreateForm:true
,onInitializeForm : function(formid){
$(formid).attr('method','POST');
$(formid).attr('action','');
$(formid).attr('enctype','multipart/form-data');
}, afterSubmit : function(response, postdata){
$.ajaxFileUpload({
url: 'application/ajax/common_file_upload.php',
secureuri:false,
fileElementId:'STUDENT_AVATAR',
dataType: 'json',
success: function (data, status) {
alert("Upload Complete.");
}
});
}
});
});
One can see that you have error in jQuery.handleError function which is depreciated from jQuery 1.5. jQuery Ajax File Uploader V2.1 provided from the download page included jQuery 1.2.1.
One have to fix the code of Ajax File Uploader to solve the problem. See the answer and the answer for example or this one. You can consider to use another Plugin for file upload like jQuery Form Plugin (and here), see here.

Resources