You could use photoshop or other paint program 😉
Ok, seriously. Heres one way.
Just create that gradient bar in some paint program. Then just resize(width) that image in your code and show in img tag.
<?php
$value = 50;
$maxval = 100;
$size = 300; // MaxSize of image when $value is 100
$x2 = floor(($value / $maxval)* $size);
?>
<img src="barpic.png" width="<?php echo $x2; ?>">
You can also use CSS to create that..