i'm using primeng charts (based on chart.js). know want set maximum number of labels show. docs show this: ticks.max string - maximum item display. must value in labels array
but don't know put , couldn't find anywhere in interwebs. chart options right now:
this.options = { animation: false, legend: { display: true, labels: { boxwidth: 0, } }, scales: { yaxes: [{ scalelabel: { display: true, labelstring: "ms" }, ticks: { beginatzero: true, suggestedmax: 100, } }], xaxes: [{ scalelabel: { display: true, labelstring: "sec" }, ticks: { beginatzero: true, } }] } }
i've tried adding ticks.max on different places in options, "unexpected token" error. can set "max" value within "ticks", hast number , not im looking for. and, also, docs above tell ticks.max string labels array. "max" value within ticks object has else.
this might stupid question, searching long time , couldn't ask.
according documentation if want create category scale
should work this:
..... scales: { yaxes: [{ scalelabel: { display: true, labelstring: "ms" }, ticks: { beginatzero: true, suggestedmax: 100, } }], xaxes: [{ scalelabel: { display: true, labelstring: "sec" }, ticks: { beginatzero: true, max: "a-value-from-array" } }] }
i'm tempted guess using notation like:
var y = { ticks.max: "hello" } vm181:1 uncaught syntaxerror: unexpected token .
i think explains error.
Comments
Post a Comment