Skip to content

Instantly share code, notes, and snippets.

@doctea
Created March 12, 2019 10:39
Show Gist options
  • Save doctea/134fa35dd359380071ad426377d28cc5 to your computer and use it in GitHub Desktop.
Save doctea/134fa35dd359380071ad426377d28cc5 to your computer and use it in GitHub Desktop.
40c40,41
< const API_URL = 'http://chart.apis.google.com/chart';
---
> //const API_URL = 'http://chart.apis.google.com/chart';
> const API_URL = 'https://image-charts.com/chart'; // use image-charts.com free, since Google's charts API is deprecated and being shut off in first half of March 2019
103c104
< protected $_encoding = 'e';
---
> protected $_encoding = 'a'; //
273a275,279
> } else if ($this->_encoding == "a") {
> $params['chd'] = "a:";
> $dataDelimiter = ",";
> $dataSetdelimiter = ",";
> $dataMissing = "0";
337a344,354
> } else if ($this->_encoding == "a") {
> //array_push($chartdata, implode(",",$thisdataarray[0]));
> Mage::log("thisdatarray:", 0, "chart.log");
> Mage::log(var_export($thisdataarray,true),0,"chart.log");
> foreach ($thisdataarray as $v) {
> if (empty($v) || $v==0)
> $chartdata[] = $dataMissing;
> else
> $chartdata[] = $v;
> $chartdata[] = $dataDelimiter;
> }
362a380,382
> Mage::log("allseries:" . var_export($this->getAllSeries(),true), 0, "chart.log");
> Mage::log("buffer: " .var_export($buffer,true), 0, "chart.log");
>
438a459,469
> Mage::log("------", 0, "chart.log");
> Mage::log("chxl: " . var_export(explode("|",$params['chxl']),true), 0, "chart.log");
> Mage::log("chxt: " . var_export(explode("|",$params['chxt']),true), 0, "chart.log");
> Mage::log("chg: " . $params['chg'], 0, "chart.log");
> Mage::log("chs: " . $this->getWidth().'x'.$this->getHeight(), 0, "chart.log");
> Mage::log("------", 0, "chart.log");
>
>
> Mage::log("params:\n".var_export($params,true), 0, "chart.log");
>
@doctea
Copy link
Author

doctea commented Mar 12, 2019

Instructions:
Copy app/code/core/Mage/Adminhtml/Dashboard/Graph.php to app/code/local/Mage/Adminhtml/Dashboard/Graph.php and then apply this patch to it.

@doctea
Copy link
Author

doctea commented Mar 12, 2019

See also https://gist.github.com/doctea/34947c7b09b378f6a595effdaa98054b for a script for testing/comparing graph output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment