Draw event not triggering when printing to pdf
I'm using the draw event to change the colors of a pie chart dynamically as per stated on the docs here and it's working just fine. The problem is that on my backend I'm using chrome headless to render the page and print it to pdf but the output pdf does not reflect the changed colors and instead uses the default colors. Any clues on what might be happening. Here's the code I'm using: Colors is an array i'm given with the color for each data value
chart.on('draw', function(context) {
if(context.type === 'slice') {
context.element.attr({
style: 'fill: ' + colors[idx]
});
idx++;
}
});
Hello man from the past who probably does not need this information anymore
If you go into the chartist code you can find two places where its emitting 'data' events
Comment that out and it should go through smoothly. I sadly could not be bothered figuring out what in those events is breaking but i guess you probably don't need them.