I am trying to embed an interactive plot into a ConText presentation. I'm not entirely sure if this is possible. I am using javascript code from amCharts. For this I need three java scripts, two of which are fairly long, so I figured I could try to read them in using the \input command (not sure if this works within \startJScode)
From there I make the chart and call the object "plot." If I wanted to draw this plot in html I would simply create a div container. How can I make container (field?) in context to draw the chart? Also how can I reference the "plot" object in the container/field?
Here is the way I have set up the JS code:
\setuppapersize[S6][S6]
\setuppagenumbering[state=stop]
\setuptolerance[verytolerant,stretch]
\switchtobodyfont[modern,20pt]
\setupbackgrounds[page][background=color,backgroundcolor=white]
\usemodule[fields,abr-pseudocaps]
\starttext
\startJScode {EXAMPLE}
\input amchars.js
\input serial.js
AmCharts.makeChart("plot",{
"type": "serial",
"categoryField": "category",
"categoryAxis": {
"gridPosition": "start"
},
"graphs": [
{
"title": "Graph title",
"valueField": "column-1"
}
],
"valueAxes": [
{
"title": "Axis title"
}
],
"legend": {
"useGraphSettings": true
},
"titles": [
{
"size": 15,
"text": "Chart Title"
}
],
"dataProvider": [
{
"category": "category 1",
"column-1": 8
},
{
"category": "category 2",
"column-1": 10
},
]
});
\stopJScode
\stoptext