{"action":"created","issue":{"url":"https://api.github.com/repos/amcharts/amcharts4/issues/292","repository_url":"https://api.github.com/repos/amcharts/amcharts4","labels_url":"https://api.github.com/repos/amcharts/amcharts4/issues/292/labels{/name}","comments_url":"https://api.github.com/repos/amcharts/amcharts4/issues/292/comments","events_url":"https://api.github.com/repos/amcharts/amcharts4/issues/292/events","html_url":"https://github.com/amcharts/amcharts4/issues/292","id":354360472,"node_id":"MDU6SXNzdWUzNTQzNjA0NzI=","number":292,"title":"Offsets in gradients are not working ","user":{"login":"Varshamathukumalli","id":33113200,"node_id":"MDQ6VXNlcjMzMTEzMjAw","avatar_url":"https://avatars2.githubusercontent.com/u/33113200?v=4","gravatar_id":"","url":"https://api.github.com/users/Varshamathukumalli","html_url":"https://github.com/Varshamathukumalli","followers_url":"https://api.github.com/users/Varshamathukumalli/followers","following_url":"https://api.github.com/users/Varshamathukumalli/following{/other_user}","gists_url":"https://api.github.com/users/Varshamathukumalli/gists{/gist_id}","starred_url":"https://api.github.com/users/Varshamathukumalli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Varshamathukumalli/subscriptions","organizations_url":"https://api.github.com/users/Varshamathukumalli/orgs","repos_url":"https://api.github.com/users/Varshamathukumalli/repos","events_url":"https://api.github.com/users/Varshamathukumalli/events{/privacy}","received_events_url":"https://api.github.com/users/Varshamathukumalli/received_events","type":"User","site_admin":false},"labels":[{"id":770370960,"node_id":"MDU6TGFiZWw3NzAzNzA5NjA=","url":"https://api.github.com/repos/amcharts/amcharts4/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-27T15:13:51Z","updated_at":"2018-08-29T11:32:44Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\n i have created a gradient and trying to change the offsets dynamically, it's not working.\r\nbelow is the snippet:\r\n\r\nconst gradient = new am4core.LinearGradient();\r\n    gradient.addColor(am4core.color('#FF0000'));\r\n    gradient.addColor(am4core.color('#f0f035'));\r\n    gradient.addColor(am4core.color('#5cd85c'));\r\n    const gradientElement = gradient.element.node;\r\n    _.forEach(gradientElement.children, (element, idx) => {\r\n        element.setAttribute('offset', idx === 0 ? '0.1' : idx === 1 ? '0.4' : '0.9');\r\n      });\r\n\r\nThe offsets are changing from 0.1, 0.4, 0.9 to 0, 0.5, 1 always\r\nHow to fix that"},"comment":{"url":"https://api.github.com/repos/amcharts/amcharts4/issues/comments/416920428","html_url":"https://github.com/amcharts/amcharts4/issues/292#issuecomment-416920428","issue_url":"https://api.github.com/repos/amcharts/amcharts4/issues/292","id":416920428,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjkyMDQyOA==","user":{"login":"Varshamathukumalli","id":33113200,"node_id":"MDQ6VXNlcjMzMTEzMjAw","avatar_url":"https://avatars2.githubusercontent.com/u/33113200?v=4","gravatar_id":"","url":"https://api.github.com/users/Varshamathukumalli","html_url":"https://github.com/Varshamathukumalli","followers_url":"https://api.github.com/users/Varshamathukumalli/followers","following_url":"https://api.github.com/users/Varshamathukumalli/following{/other_user}","gists_url":"https://api.github.com/users/Varshamathukumalli/gists{/gist_id}","starred_url":"https://api.github.com/users/Varshamathukumalli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Varshamathukumalli/subscriptions","organizations_url":"https://api.github.com/users/Varshamathukumalli/orgs","repos_url":"https://api.github.com/users/Varshamathukumalli/repos","events_url":"https://api.github.com/users/Varshamathukumalli/events{/privacy}","received_events_url":"https://api.github.com/users/Varshamathukumalli/received_events","type":"User","site_admin":false},"created_at":"2018-08-29T11:32:44Z","updated_at":"2018-08-29T11:32:44Z","author_association":"NONE","body":"@martynasma ,\r\n\r\nBelow is how the horizontal linear gradient looks,\r\n<linearGradient id=\"gradient\" x1=\"0%\" x2=\"100%\" y1=\"50%\" y2=\"50%\">\r\n   <stop stop-color=\"#ff0000\" stop-opacity=\"1\" offset=\"0.1\"></stop>\r\n   <stop stop-color=\"#f0f035\" stop-opacity=\"1\" offset=\"0.5\"></stop>\r\n   <stop stop-color=\"#5cd85c\" stop-opacity=\"1\" offset=\"0.8\"></stop>\r\n</linearGradient>\r\n\r\nIn the above linear gradient, i want to provide my custom start and end points from x1=0 to 20  and x2=100 to 90. and changing y1 and y2 in case of vertical linear gradient\r\nI tried updating using setAttribute. But that didn't work\r\nHow to acheive the above"}}
{"actor":{"display_login":"Varshamathukumalli"}}