datahub icon indicating copy to clipboard operation
datahub copied to clipboard

Local currency issues - y axis and toggling to USD

Open laurenceford opened this issue 7 years ago • 3 comments

I'm submitting a ...

Check one of the following options with "x" and add the appropriate label to the issue as well


[x] Bug report 
[ ] Regression (behaviour that used to work and stopped working in a new release)

Describe the Issue The local currency charts' y axes do not drop below zero, and then when you toggle back to USD, those charts suffer from the same issue.

To Reproduce Replace the content below with the steps to reproduce the behaviour.

  1. Go to a country profile
  2. Click on the government finance charts
  3. Toggle between local and USD
  4. See error

Expected Behaviour Both types of chart's y axes are scaled to below zero, where appropriate

Screenshots/GIF Nigeria: image

Desktop (please complete the following information):

  • OS: Windows 7
  • Browser: Chrome

Environment/Server:


- [ ] Production
- [x] Staging
- [ ] Test
- [ ] Development

Additional Context Add any other context about the problem here.

Requested Delivery Date: 08/10/2018

laurenceford avatar Oct 05 '18 08:10 laurenceford

This was being caused by a strange bug in the chart code. Changing the currency triggered an update in the chart (as expected), but this somehow reset the chart to some probably default configuration for the y-axis. To fix this, I added a property that would allow the conditional recreation of the chart. The condition in this instance is the currency change. The chart is literally destroyed and recreated with the correct configuration. Ideally, there should be a plottable.js API that allows the chart configs to be updated after initial render.

edwinmp avatar Oct 09 '18 07:10 edwinmp

Minor issue remains - USD Y axis alters slightly when toggled to after switching to local currency, changing the shape of the graph slightly

laurenceford avatar Oct 09 '18 09:10 laurenceford

Hi @laurenceford ... couldn't replicate the issue in your last comment. Could you please get me the steps u take to replicate it.

edwinmp avatar Jan 30 '19 10:01 edwinmp