How to turn off secondary Y Axis on a bar chart dynamically?
<p>Hi,</p>
<p>I have a requirement to conditionally display a secondary Y Axis. I can either add a secondary Y axis dynamically via script or add it as default and remove it dynamically. </p>
<p>After researching a little bit I am able to remove the secondary Y Axis using the code below but I am not able to hide/remove the secondary Y axis scale. See attached pictures for better understanding</p>
<pre class="_prettyXprint _lang-js">
//find the secondary y-axis
yAxis2 = chart.getOrthogonalAxes(xAxis,true)[1];
var ySerieDef2 = yAxis2.getSeriesDefinitions().get(0);
//either this line can be used to set the y-axis visibility to false
yAxis2.getSeriesDefinitions().get(0).getSeries().get(0).setVisible(false);
//or this line can be used to remove it
yAxis2.getSeriesDefinitions().remove(0);
</pre>
<p>I am looking to either completely get rid of secondary y-axis i.e. hide the scale as well as the axis</p>
<p>or </p>
<p>hide the scale separate and hide the axis separate (as a continuation to my earlier code)</p>
<p> </p>
<p>Thanks in advance for the help!!</p>
<p>I have a requirement to conditionally display a secondary Y Axis. I can either add a secondary Y axis dynamically via script or add it as default and remove it dynamically. </p>
<p>After researching a little bit I am able to remove the secondary Y Axis using the code below but I am not able to hide/remove the secondary Y axis scale. See attached pictures for better understanding</p>
<pre class="_prettyXprint _lang-js">
//find the secondary y-axis
yAxis2 = chart.getOrthogonalAxes(xAxis,true)[1];
var ySerieDef2 = yAxis2.getSeriesDefinitions().get(0);
//either this line can be used to set the y-axis visibility to false
yAxis2.getSeriesDefinitions().get(0).getSeries().get(0).setVisible(false);
//or this line can be used to remove it
yAxis2.getSeriesDefinitions().remove(0);
</pre>
<p>I am looking to either completely get rid of secondary y-axis i.e. hide the scale as well as the axis</p>
<p>or </p>
<p>hide the scale separate and hide the axis separate (as a continuation to my earlier code)</p>
<p> </p>
<p>Thanks in advance for the help!!</p>
0
Comments
-
<p>Added the following lines to my code to hide the scale.</p>
<pre class="_prettyXprint _lang-js">
yAxis2.getLineAttributes().setVisible(false);
yAxis2.getMajorGrid().getLineAttributes().setVisible(false);
yAxis2.getMinorGrid().getLineAttributes().setVisible(false);
yAxis2.getMajorGrid().getTickAttributes().setVisible(false);
yAxis2.getLabel().setVisible(false);
</pre>0
Categories
- All Categories
- 107 Developer Announcements
- 53 Articles
- 105 General Questions
- 141 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 898 Cloud Fax and Notifications
- 76 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 118 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management