Skip to content

Render html for tick #11351

Closed Answered by thraizz
thraizz asked this question in Q&A
Discussion options

You must be logged in to vote

A teammember has figured this out; you can just use the afterDraw to hack your data in there :D
What we're doing is iterating over each (empty) tick and then we add an Image in there:

        {
          afterDraw: (chart) => {
            const ctx = chart.ctx;
            const xAxis = chart.scales["x"];
            const yAxis = chart.scales["yScaleConsumptionAverages"];
            yAxis.ticks.forEach((value, index) => {
              let y = yAxis.getPixelForTick(index);
              const image = new Image();
              image.src =
                "data:image/webp;base64,UklGRqoAAABXRUJQVlA4WAoAAAAQAAAADwAADwAAQUxQSGkAAAABcEjbdh1dhCA8hCIUIQgPoQYdg9QgRRiDIAxCEIJw5pcPQkRMgNZaaS3bg…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by thraizz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant