Graphical representation of HTML table data using High charts - html

I am trying to display the data in HTML table in graphical form using High Charts. When I use all the data from the table I am able to render the charts. I want to use only some part of data from my table (some columns data) to render a chart. Can anyone please tell me how to do this. If you have snippets please provide them. It will be helpful for me.

All 'docs' are included inline to the data.src.js module:
http://code.highcharts.com/modules/data.src.js
For now only startRow/endRow/startColumn/endColumn options are supported:
table : String|HTMLElement
A HTML table or the id of such to be parsed as input data. Related options ara startRow, endRow, startColumn and endColumn to delimit what part of the table is used.

Related

Write Code in a Spreadsheet Using Visual Basic

I am new to Excel VBA and I am trying to achieve what is displayed in the Result column in the image. I need to develop a code in spreadheet which would create a json based on the occupation of an individual. Please advice how can I fill data in column H (Result) easily using visual basic.
As #ron rosenfeld mentioned you data is inconsistent from row to row. Is there some logic to decide what columns to use? You also don't need VBA to do this. You could use the concatenate function as below:
=CONCATENATE("{""",$A$1,""":""",A2,""",""",$B$1,""":""",B2,"""}")
The output for row two would be:
{"Occupation":"Doctor","FirstName":"Alex"}
If there are conditions you also use the IF function to only show certain columns. If it is more complex I would download the json.bas file from github and generate using that class.

How to use autodetect schema in big query app script to load string type columns as headers in bigquery table?

I have a google script that loads the csv table from cloud storage to big query. It works fine with most tables but when all the columns types are string, the auto detection is not able to find header name and it gives the column as string_01, string_02. Here's is the part of the code.
load.setDestinationTable(tableReference);
load.setSourceUris([source]);
load.setSourceFormat('CSV');
load.setAutodetect(true);
load.setMaxBadRecords(0);
load.setWriteDisposition('WRITE_TRUNCATE');
Does anyone know what can I add to the code to have the first line be selected as the header for the table. Any help would be appreciated.
You may have to add skip_leading_rows.
load.skipLeadingRows(1)
This will let the API know that 1st row is a header and should not be used as part of the "data" import.

I'm getting errors in documents generated with python-docx, specifically if I include tables from a template

I am using python-docx to programmatically insert data into a new document. When opening the new file, I get the following error message.
Word found unreadable content in document_name. Do you want to recover the contents of this document? If you trust the source of this document, click Yes.
Here is the process that my code is going through to get to this point:
Copy a docx file that we will call our findings templates to a
working folder
Copy another docx file that is our report document to the same working folder
Locate a table in our findings document that we want to include in the report
Fill in some data in the table, and put the now completed table into the report document.
Save the report document as a new file, called generated.docx
What I have figured out so far:
If I don't fill in any information in the table, and just copy it
from the findings templates into the report, I still get the above
error message.
If I insert other data into the report without the
table from the findings templates the document is all good with no
errors.
The source files have no errors, at least Word doesn't complain when opening either the findings document or the report document.
If I let Word correct the errors, all hyperlinks in the document are broken, the text for the link is there along with the link style, but the target is missing, and when looking at the document after hitting alt+F9, you can see { HYPERLINK } indicating the missing target as well.
After quite a bit of googling and finding some similar answers that haven't resolved the issue, I feel like this might be relevant. The tables in the findings document contain a large number of merged cells. It is only one table, not nested tables as I initially thought they were.
Heading is 2 rows deep with 4 merged cells on the left for the finding title and then on the right are two columns with headings and relevant data below. Then the body of the table is a mixture of merged cells per row. Some rows will have all cells merged, others with have 2 cells merged out of 3.
Here is the code I am using to snag the table from the findings document:
for table in findings_templates.tables:
row = table.rows[0]
for cell in row.cells:
if title.lower() in cell.text.lower():
severity = get_severity_from_template(table)
for item in severity_array:
if severity in item[1]:
anchor = item[0]
# snip
# Insert some data into table here
# snip
addTableAfterParagraph(report_document, table, title)
return True
Since the errors occur with our without modification, ill leave out the modification code. Here is the code that inserts the table into the template document:
def addTableAfterParagraph(report_document, table, title):
for para in report_document.paragraphs:
if para.text == title:
p = para._p
p.addnext(table._tbl)
Additionally, I added some print lines for table._tbl.xml and I don't see much of a difference between the source table and the one inserted into the document except for the first line has a few differing xmlns tags.
I'd love some troubleshooting tips, or any suggestions. Let me know if any more information is needed. Thanks in advance!
UPDATE: It's the hyperlinks in the source table that are causing the issue. I'm marking this solved for now and may open another more specific question if I can't figure it out.
I ended up reading data from the source document tables, then creating my own tables programmatically, and inserting that data back in along with performing any transforms, such as creating hyperlinks, styles, etc.
It was painful, but ultimately solved the issue and provides flexibility in the future.

Dynamic dimension used in Qlik bar chart is not filtering data on selecting any bars

I've created a bar chart in Qlik dashboard. Using inline load I've added static data to filters(Listbox) of my dashboard. It is unavoidable so have taken static data for filters.
Based on the item selected in filters(ListBox) by user I'm creating a dynamic dimension on qlik bar chart using actual fields from the data source. but when I click on any bar its not filtering all associated data of dashboard and even bar chart is also not filtering accordingly.
Can you please suggest any workaround for this.
Thanks
You could try to split the data source column into something you could use for filtering. I'll assume that the column coming from the Data Source is named ProductCode. In the LOAD script you'll have something like :
LOAD
...
ProductCode,
...
You could try to add two new columns like this :
LOAD
...
ProductCode,
Left(ProductCode, 2) as ProductCodePrefix,
Right(ProductCode, 1) as ProductCodeSuffix,
...
Could this help?

How to query a Lotus view and have the result formatted as json?

I have a view called 'walking' which I want to query:
http://site/activity.nsf/walking?searchview&query=FIELD%20Gradient%20CONTAINS%20gradienteasy.gif
This returns the results in an HTML table. What I would like to do is have the results formatted as JSON which I will then use client-side. Is this possible?
I know you can get JSON returned from a straight view by doing this:
http://site/activity.nsf/walking?readviewentries&outputformat=json
Scott Good and I have done several sessions at a variety of conferences on generating and consuming JSON from traditional Domino applications (not using XPages). The most recent was the "JMP303 JSON in client- and server-side code Master Class" we gave at Lotusphere 2011. Link to the presentation materials and slides are: here
/Newbs
You will have to create a view that is marked with the "Treat view contents as HTML" property and set up a column formula that generates the JSON syntax that you want'.
There is a nice post on OpenNTF with the code to create a very generic view which returns JSON for the documents that match the View's selection formula:
http://openntf.org/XSnippets.nsf/snippet.xsp?id=use-transform-to-build-json-and-consume-the-output-in-an-xagent
That sample uses an "XAgent" (Xpage with no UI) to set the content-type header, etc. But you could probably do the same thing using a $$ViewTemplate form, if needed.