0 ? 'positive' : 'negative' ) : 'n/a';
if ( ! empty( $invert ) ) {
$diff_class = 'n/a' !== $diff ? ( $diff < 0 ? 'positive' : 'negative' ) : 'n/a';
}
$diff_sign = '' . ( 'positive' === $diff_class ? '▲' : '▼' ) . '';
if ( 0.0 === floatval( $diff ) ) {
$diff_class = 'no-diff';
$diff_sign = '';
}
$stat_value = $value;
$stat_diff = 'n/a' !== $diff ? abs( $diff ) : 'n/a';
// Human number is 'true' by default.
if ( ! isset( $human_number ) || $human_number ) {
$stat_value = Str::human_number( $stat_value );
$stat_diff = Str::human_number( $stat_diff );
}
?>
$value ) {
if ( ! empty( $value ) ) {
$show_graph = true;
}
// Adjust values.
if ( ! empty( $graph_modifier ) ) {
$graph_data[ $key ] = abs( $graph_data[ $key ] + $graph_modifier );
}
}
if ( ! $show_graph ) {
return;
}
// `img` tag size.
// Actual image size is 3x this.
$width = 64;
$height = 34;
$this->image( $this->charts_api_url( $graph_data, $width * 3, $height * 3 ), $width, $height, __( 'Data Chart', 'seo-by-rank-math' ), [ 'style' => 'float: right;margin-top: -7px;' ] );
} ?>