Hi Tomáš (or others who might know),
I’m trying to use line charts, but they work only with one line (of data):
"""
\usemodule[statistical-charts]
\starttext
\chart[line][basic][
xunit=Year,
yunit=Millions of …,
axesunits=yes,
][
data={7.25,2,9,3,6,5}, % works
%data={{7.25,2,9,3,6,5},{0.1,0.1,0.2,0.01,0.3,0.5}}, % doesn’t
xlabels={2001,2002,2003,2004,2005,2006},
]
\stoptext
"""
The error is:
"""
token call, execute:
...ontext/third/statistical-charts/t-statistical-charts.lua:1608:
attempt to mul a 'string' with a 'number'
stack traceback:
[C]: in metamethod 'mul'
...ontext/third/statistical-charts/t-statistical-charts.lua:1608: in
field 'changeaxeslength'
...ontext/third/statistical-charts/t-statistical-charts.lua:1515: in
field 'all'
"""
I get the same error if I try to call it from Lua code with a Lua table,
like
\startluacode
context.linechart({"basic"},{
xunit = "Year",
yunit = "Millions of …",
axesunits = "yes",
},{
data = {7.25,2,9,3,6,5},
xlabels = {2001,2002,2003,2004,2005,2006}
})
\stopluacode
Additional questions:
– Can I label the lines? E.g. Cows, Dodos…
– Could you please document how to use the module from Lua (CLD)?
Hraban
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________