Skip to content

Dashboard graph has broken y-axis range #7927

Closed
@tomasinchoo

Description

@tomasinchoo

Y-axis on dashboard graph always shows range 0 to 100 in steps of 10. That means quantity and amounts do not match actual value in graph.

Preconditions

  1. Any working setup for Magento 2
  2. Tested on 2.1.1, but it probably doesn't work in any other

Steps to reproduce

  1. Make few orders and look at the graph in admin dashboard

Expected result

  1. Values shown should be matched with y-axis value

Actual result

  1. It always show range 10 to 100 in steps of 10 and values (qty and amounts) doesn't make sense with that values

Fortunately, that issue is easy to fix:
This code (exists in M1, not in M2) needs to be inserted on line 424 in vendor/magento/module-backend/Block/Dashboard/Graph.php (thanks to @ivanweiler)

                } else if ($idx == 'y') {
                    $valueBuffer[] = $indexid . ":|" . implode('|', $yLabels);   

Metadata

Metadata

Assignees

Labels

Issue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasebug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions