Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoOffsetAxis Adding/Changing value axes results in offset resetting to 0 #15

Open
yogeshmangaj opened this issue Feb 17, 2017 · 4 comments

Comments

@yogeshmangaj
Copy link

If you change or add value axes and call chart.validateNow() the offset defaults to original values and is not corrected by autoOffset plugin.

To reproduce, please append the following lines to the JS at this codepen http://codepen.io/amcharts/pen/4130820114230f81677ba52fb260a53d after a timeout of 5 seconds you can see that offsets of all 3 axes are 0.

setTimeout(function(){
  console.log('validating now')
  chart.valueAxes = [{
    "id": "v1",
    "axisColor": "#FF6600",
    "axisThickness": 2,
    "gridAlpha": 0,
    "axisAlpha": 1,
    "position": "left",
    "tickLength":0,
    "autoOffset": true
  }, {
    "id": "v2",
    "axisColor": "#FCD202",
    "axisThickness": 2,
    "gridAlpha": 0,
    "axisAlpha": 1,
    "position": "left",
    "tickLength":0,
    "autoOffset": true
  }, {
    "id": "v3",
    "axisColor": "#B0DE09",
    "axisThickness": 2,
    "gridAlpha": 0,
    "axisAlpha": 1,
    "tickLength":0,
    "position": "left",
    "autoOffset": true
  }];
  chart.validateNow()
}, 5000)
@Shepsy
Copy link

Shepsy commented Mar 9, 2017

Yep. Am able to replicate by calling validateNow() also.

@martynasma
Copy link
Collaborator

The version 1.4 now adds a publicly-accessible method to chart objects: updateOffsets().

You can now modify your code to call it after you update something in the config.

@piers-shepherd-sift
Copy link

Hi @martynasma

Many thanks for your work on this.

Do you have a date for release of version 1.4?

@martynasma
Copy link
Collaborator

Hey, sorry missed your reply. 1.4 was already available at the moment of my post.

https://github.com/amcharts/tools/tree/master/autoOffsetAxis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants