Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
suppress unneeded y axis
omittag
I have a scripted data set which returns data for 1 to 6 kines ( with 1 to 6 y axis). At design time I have a chart with all 6 y axis. Dependent on the data I can change the y axis title and labels to invisible for the obsolete y axis, but the axis itself remains. How can I make the y axis invisible as well ?
Regards - Oliver
Find more posts tagged with
Comments
mwilliams
Hi Oliver,
Can you provide an example of this that I can run, so I can see exactly what the issue is?
omittag
Hi Michael,<br />
we found the following solution:<br />
@Override<
;br />
public void beforeGeneration(Chart c, IChartScriptContext icsc) {<br />
// methods from scripted data set .. start<br />
GanglinienChart chartData = getGanglinienChart(icsc);<br />
<br />
Integer anzahlYAchsen = chartData.getAnzahlYAchsen();<br />
// methods from scripted data set .. start<br />
adjustYAchsen(c, anzahlYAchsen);<br />
<br />
}<br />
private void adjustYAchsen(Chart c, Integer anzahlYAchsen) {<br />
<br />
ChartWithAxes chart = (ChartWithAxes) c;<br />
<br />
Axis xAxis = chart.getBaseAxes()[0];<br />
boolean bIncludePrimary = true;<br />
Axis[] orthogonalAxes = chart.getOrthogonalAxes(xAxis, bIncludePrimary);<br />
<br />
EList<Axis> yAxes = xAxis.getAssociatedAxes();<br />
<br />
if(yAxes.size()!=anzahlYAchsen) {<br />
<br />
yAxes.clear();<br />
<br />
for (int i = 0; i < anzahlYAchsen; i++) {<br />
yAxes.add(orthogonalAxes
);<br />
}<br />
}<br />
}<br />
<br />
Basically we remove all y axis and then add the needed ones ....<br />
Best regards - Oliver
mwilliams
Oliver,
Excellent. Glad you found a solution. Let us know whenever you have questions.