Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

MortgageRates_Charts::add_15us_data_for_amchart( array $data, array $result )

Add 15US data to data for amchart.


Parameters Parameters

$data

(array) (Required) data for amchart

$result

(array) (Required) data of FMAC/5US


Top ↑

Return Return

(mixed)


Top ↑

Source Source

File: mortgage-rates-widget/inc/MortgageRates_Charts.php

    private function add_15us_data_for_amchart($data, $result)
    {
        if (isset($result['dataset']) && isset($result['dataset']['data'])) {
            foreach ($result['dataset']['data'] as $value) {
                $d = strtotime($value[0]);
                $oney = strtotime("-1 Year");
                if ($oney < $d) {
                    $data[$value[0]] = array(
                        "15y" => $value[1],
                        "30y" => 0,
                        "5y" => 0,
                    );
                }
            }
        }
        return $data;
    }

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.