How to include plugins when exporting my chart? - highcharts

How do I include plugins for use with the highcharts-export-server? I am trying to use the highcharts-regression plugin.
I tried to use the -resources option to specify the plugin's JS file (both as a local file and as a full URL) file but no regression lines are added to my charts, unlike my browser based version which has the regression lines added.
My command is:
highcharts-export-server
-resources: {"files":"https://github.com/streamlinesocial/highcharts-regression/blob/master/highcharts-regression.js"}
-instr '{"chart":{"type":"line"},"title":{"text":"Total Downtime"},"xAxis":{"type":"datetime","dateTimeLabelFormats":{ day: "%b %Y"}},"yAxis":{"allowDecimals":false,"min":0,"tickInterval":1,"title":{"text":"Percentage"}},"series":[{"name":"BOILER 04/WATERWALL","color":"#2f7ed8","regression":true,"regressionSettings":{"name":"BOILER 04/WATERWALL trend","type":"linear","dashStyle":"dash","color":"#2f7ed8"},"data":[{"x":1451599200000,"y":0,"viewType":"M"},{"x":1454277600000,"y":0,"viewType":"M"},{"x":1456783200000,"y":0,"viewType":"M"},{"x":1459461600000,"y":0,"viewType":"M"},{"x":1462053600000,"y":0,"viewType":"M"},{"x":1464732000000,"y":4.97,"viewType":"M"},{"x":1467324000000,"y":4.89,"viewType":"M"},{"x":1470002400000,"y":0,"viewType":"M"},{"x":1472680800000,"y":0,"viewType":"M"},{"x":1475272800000,"y":0,"viewType":"M"},{"x":1477951200000,"y":0,"viewType":"M"},{"x":1480543200000,"y":0,"viewType":"M"},{"x":1483221600000,"y":0,"viewType":"M"},{"x":1485900000000,"y":0,"viewType":"M"},{"x":1488319200000,"y":0,"viewType":"M"},{"x":1490997600000,"y":0,"viewType":"M"},{"x":1493589600000,"y":0,"viewType":"M"},{"x":1496268000000,"y":0,"viewType":"M"},{"x":1498860000000,"y":0,"viewType":"M"}]}]}'
-outfile sample.png
The chart is generated fine but without the regression plugin features added. The same sort of code works fine when generating the chart in the browser, not using the export-server. Thanks!

This works with a few minor "type-o" fixes. Given the above command you've provided, I've changed -resources: {...} to --resources '{...}', as well as -instr to --instr and -outfile to --outfile, as per the documentation. Although, I think only the colon as well as the quoting are the relevant changes:
highcharts-export-server
--resources '{"files":"highcharts-regression.js"}'
--instr '{"chart":{"type":"line"},"title":{"text":"Total Downtime"},"xAxis":{"type":"datetime","dateTimeLabelFormats":{ day: "%b %Y"}},"yAxis":{"allowDecimals":false,"min":0,"tickInterval":1,"title":{"text":"Percentage"}},"series":[{"name":"BOILER 04/WATERWALL","color":"#2f7ed8","regression":true,"regressionSettings":{"name":"BOILER 04/WATERWALL trend","type":"linear","dashStyle":"dash","color":"#2f7ed8"},"data":[{"x":1451599200000,"y":0,"viewType":"M"},{"x":1454277600000,"y":0,"viewType":"M"},{"x":1456783200000,"y":0,"viewType":"M"},{"x":1459461600000,"y":0,"viewType":"M"},{"x":1462053600000,"y":0,"viewType":"M"},{"x":1464732000000,"y":4.97,"viewType":"M"},{"x":1467324000000,"y":4.89,"viewType":"M"},{"x":1470002400000,"y":0,"viewType":"M"},{"x":1472680800000,"y":0,"viewType":"M"},{"x":1475272800000,"y":0,"viewType":"M"},{"x":1477951200000,"y":0,"viewType":"M"},{"x":1480543200000,"y":0,"viewType":"M"},{"x":1483221600000,"y":0,"viewType":"M"},{"x":1485900000000,"y":0,"viewType":"M"},{"x":1488319200000,"y":0,"viewType":"M"},{"x":1490997600000,"y":0,"viewType":"M"},{"x":1493589600000,"y":0,"viewType":"M"},{"x":1496268000000,"y":0,"viewType":"M"},{"x":1498860000000,"y":0,"viewType":"M"}]}]}'
--outfile sample.png
This successfully gives me the following result with Highcharts export server 2.0.24:
Also, if attempting to use an URL you should probably point to the raw file, but I didn't have any success doing so, so I used a local version of the highcharts-regression.js file.

Related

How to set font in Texinfo

I'm using the GNU texinfo package to generate both PDF and .info files from a .texi file.
I'm trying to update an old .texi file (not changed since 2001) and generate the same PDF output. I've resolved a number of issues, but there are a couple outstanding. In the old PDF, the title was in Helvetica and body text is Liberation Serif. In the new PDF, both are Computer Modern.
I've read everything that I can find about fonts, but I'm not able to change the fonts. Nothing that I do seems to work. Everything I have tried generates errors.
In my .texi file, before any \setfont directives, I have \def\fontprefix{uh} which, if I read the pdftex.map file correctly, should select the NimbusSanL font set (e.g. uhvr8a.pfb). I get the following errors:
mktexnam: Could not map source abbreviation for uhss10.
kpathsea: Running mktexmf uhss10
! I can't find file uhss10'.
<*> ...ljfour; mag:=1; ; nonstopmode; input uhss10`
Does anyone have a example .texi file which sets the font family to use? Or an explanation of what I'm doing wrong?

Dynamically use current date in OUTPUT EXPORT filename

Stripped down example code using a static file name:
OUTPUT EXPORT /CONTENTS EXPORT=ALL /PDF DOCUMENTFILE='example.pdf'
My question is how to generate a datestamped file. I have tried using $DATE, '$DATE' and running it through a macro but can't seem to find the syntax.
Hey this is a really nice Idea for saving backups in a running syntax production - I will use this myself from now on :) .
So the following syntax works for me:
compute tdy= $time.
formats tdy (date11).
temporary.
select if $casenum=1.
write out="somepath\datemacro.sps" /"define !dated__filename () !quote(!concat('YOUR FILE NAME',' ','", tdy, "','.pdf')) !enddefine.".
exe.
Insert file ="somepath\datemacro.sps".
delete vars tdy.
The file name you used in the code above is now stored in a macro with the date added, and you can use it here:
OUTPUT EXPORT /CONTENTS EXPORT=ALL /PDF DOCUMENTFILE= !dated__filename .
Note that you can change "YOUR FILE NAME" into anything you like, including adding a path. And you can also change ".pdf" so save other kinds of files.
EDIT: Also of course change "somepath" to a valid path on your machine.

How can I pass a pointer to a file in helm upgrade command?

I have a truststore file(a binary file) that I need to provide during helm upgrade. This file is different for each target env(dev,qa,staging or prod). So I can only provide this file at time of deployment. helm upgrade --set-file does not take a binary file. This seem to be the issue I found here: https://github.com/helm/helm/issues/3276. This truststore files are stored in Jenkins Credential store.
As the command itself is described below:
--set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2)
it is also important to know The Format and Limitations of
--set.
The error you see: Error: failed parsing --set-file data... means that the file you are trying to use does not meet the requirements. See the example below:
--set-file key=filepath is another variant of --set. It reads the
file and use its content as a value. An example use case of it is to
inject a multi-line text into values without dealing with indentation
in YAML. Say you want to create a brigade project with certain value
containing 5 lines JavaScript code, you might write a values.yaml
like:
defaultScript: |
const { events, Job } = require("brigadier")
function run(e, project) {
console.log("hello default script")
}
events.on("run", run)
Being embedded in a YAML, this makes it harder for you to use IDE
features and testing framework and so on that supports writing code.
Instead, you can use --set-file defaultScript=brigade.js with
brigade.js containing:
const { events, Job } = require("brigadier")
function run(e, project) {
console.log("hello default script")
}
events.on("run", run)
I hope it helps.

Error while generating make latexpdf with sphinx

I am currently using sphinx 1.4.9 for documents creation. While giving make latexpdf, I get the following error.
(/usr/share/texmf/tex/latex/upquote/upquote.sty)
(/usr/share/texmf/tex/latex/float/float.sty)
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/lib/texmf/tex/latex/config/graphics.cfg)))
(/usr/share/texmf/tex/plain/misc/pdfcolor.tex)
(/usr/share/texmf/tex/latex/hyperref/hyperref.sty
(/usr/share/texmf/tex/latex/hyperref/pd1enc.def)
(/usr/lib/texmf/tex/latex/config/hyperref.cfg)
(/usr/share/texmf/tex/latex/oberdiek/kvoptions.sty)
****! Package keyval Error: pdfencoding undefined.****
See the keyval package documentation for explanation.
I have searched for pdfencoding in the sphinx.egg, also it only appears in sphinx.sty.
but I don't know how to define this pdfencoding. whether to edit conf.py or how to do.
Your hyperref is outdated. Sphinx 1.4.x series was tested to work with Ubuntu Precise (Debian/TeXLive 2009). I can not try it but here is a hack which may help you out. However, perhaps other parts will fail as your TeX install is really old...
put
'passoptionstopackages' : """
\\let\\originalPassOptionsToPackage\\PassOptionsToPackage
\\makeatletter
\\def\\PassOptionsToPackage#1{%
\\def\\#tempa{#1}\\def\\#tempb{pdfencoding=unicode}%
\\ifx\\#tempa\\#tempb\\expandafter\\#gobbletwo
\\else\\expandafter\\originalPassOptionsToPackage\\fi {#1}}
\\makeatother
""",
inside the latex_elements configuration variable of conf.py. Could work ...

Offending Command error while Printing EPS

I am printing an EPS File generated with following credentials.
%-12345X#PJL JOB
#PJL ENTER LANGUAGE = POSTSCRIPT
%!PS-Adobe-3.0
%%Title: InvoiceDetail_combine
%%Creator: PScript5.dll Version 5.2.2
%%CreationDate: 10/7/2011 4:46:59
%%For: Administrator
%%BoundingBox: (atend)
%%Pages: (atend)
%%Orientation: Portrait
%%PageOrder: Special
%%DocumentNeededResources: (atend)
%%DocumentSuppliedResources: (atend)
%%DocumentData: Clean7Bit
%%TargetDevice: (HP Color LaserJet 4500) (2014.200) 0
%%LanguageLevel: 2
%%EndComments
While doing Selection Printing on Ricoh Afficio 2090 or any other drivers/printers get the following error printed on the sheets
ERROR: undefined
OFFENDING COMMAND: F4S47
Stack:
.
Kindly Review and suggest a turn around for the same as i am already stuck in this hell. I have tried to convert/extract in PS but all in vain. I am using gsview to Print and view these files.
This is the problem:
%%PageOrder: Special
A ps document with "Special" page order can NOT be re-ordered. You cannot do a selection or range with this file because it is broken for this use. You must reprocess the file using Distiller or ghostscript (ps2ps or ps2pdf) in order to print selected or re-ordered pages from the document.
You can avoid this by generating your postscript files with a real Postscriptâ„¢ driver (one not created by Microsoft).
The GSView Documentation has more about this.
Previously:
This line ...
%%TargetDevice: (HP Color LaserJet 4500) (2014.200) 0
... tells us that the file was generated with HP printers as a target. So this really is not an EPS file. Because it's not Encapsulatable. To generate output on a printer the file has to execute the showpage operator, which is a no-no for EPS files.
So uncheck the EPS box (it's a big fat lie, anyway), and select (install) a Generic Postscript driver. If you need to send it to multiple makes of printer, the file needs to make as few assumptions about the printer as possible.
The first thing is that this is not a valid EPS file, as it has PJL attached at the front. Many PostScript printers will strip this off, but by no means all.
This probably is not the source of the problem.
There is no way to 'review' the problem as you have not supplied the complete PostScript program. Without that there is no way to tell what is actually wrong, the error message tells you that the interpreter encountered 'F4547' while trying to parse a token, and that this has not been defined as a routine.
Most likely the file is corrupt, either damaged in some way, or possibly it is a biinary file and has been transmitted by some process which does has done some kind of conversion (CR/LF is common). The offending command looks like its ASCIIHex encoded, so that may be a red herring.
If you want additional help, you are going to have to make the whole program available somewhere.

Resources