We use a request like this to obtain a sparkline image which we embed in various places. In Matomo 5, the sparkline width got oddly thicker and I’m wondering if someone can point me to reference on whether there’s a “linewidth” or similar inputs to tweak this back to the way it was.
There isn’t a way via a parameter to set the line width for spark lines. In the code the thickness is set to 1 pixel.
The relevant file is:
core/Visualization/Sparkline.php
In the sparkline initialization code, around lines 109–112:
$sparkline->setWidth($this->getWidth());
$sparkline->setHeight($this->getHeight());
$sparkline->setLineThickness(1); <------- this one
$sparkline->setPadding('5');
But altering that may not make a difference. Did you find going from Matomo 4 to 5 that the line looks thicker?
We reviewed the code and instead doubled the native size of the image request and forced the tag width the same. The @2x pixel density fixed the issue.
I saw this:
public const DEFAULT_WIDTH = 200;
public const DEFAULT_HEIGHT = 50;
public const LINE_THICKNESS = 4;
public const POINT_SIZE = 6;
...
$sparkline->setLineThickness(self::LINE_THICKNESS);