Dear Hans

I tried this code, but it didn't work. This is not my day.


%%%%%%%%%%%%%%%
\starttext

\startluacode
 document.samples = {
 { 10, 30, 30, 40, 50 }
 }

 function document.dados()
 return { { 10, 30, 30, 40, 50 }}
 end
\stopluacode

\startMPcode
 draw lmt_chart_bar [
 samples = "table.load('document.dados')",
 percentage = true,
 cumulative = true,
 showlabels = false,
 backgroundcolor = "lightgray",
 ] ;
\stopMPcode

\startMPcode

draw lmt_chart_bar [
 width = 8cm,
 height = 10mm,
 trace = true,
 maximum = 100,
 linewidth = 1mm,
 showlabels = false,
 samples = "document.samples",
 originsize = 0,
 labelanchor = "lft",
 labelcolor = "black"
 labelstyle = "bfxx"
 legendstyle = "tfxx",
 labelstrut = "yes",
] ;
\stopMPcode

\stoptext
%%%%%%%%%%%%%%%%%%%%%

Jorge Magalhães

On 23 Jul 2021, 16:58 +0100, Hans Hagen <j.hagen@xs4all.nl>, wrote:

\startMPcode

draw lmt_chart_bar [
width = 8cm,
height = 10mm,
trace = true,
maximum = 100,
linewidth = 1mm,
showlabels = false,
sampleset = "document.samples",
originsize = 0,
labelanchor = "lft",
labelcolor = "black"
labelstyle = "bfxx"
legendstyle = "tfxx",
labelstrut = "yes",
] ;
\stopMPcode