Data range embedded

I’m importing some parts of piwik’s plataform as charts and table to another page and appears a problem.
How choose a different date range? I know that is just change the parameter date of URL but i would enjoy use the code made by piwik to change the interval of date.

Is it possible import the data range of piwik to use in this imported charts?

See core/Date.php and core/Period.php but better use API parameters.