robinm_1 Posted July 12, 2016 Share Posted July 12, 2016 Mariano suggests that it's possible to assign a specific measure to the line series for multi-axis charts."In that chart type the last measure is always the line (you can change this in the advanced properties if you want)" -http://community.jaspersoft.com/questions/843913/jasper-multi-axis-report-high-chartIs there an example/documentation for this?Can multiple measures be assigned as lines to the secondary axis and if so how? Link to comment Share on other sites More sharing options...
Solution lucianc Posted July 12, 2016 Solution Share Posted July 12, 2016 You can explicitly create Y axes and assign series to specific axes.See the attached sample report: the yAxis chart settings creates a new axis (_jrAxisIndex=1 means it's the second axis) and sets some properties for it, and SeriesProperty contributors set the series types and assings the series to the second axis.Regards,Lucian Link to comment Share on other sites More sharing options...
robinm_1 Posted July 13, 2016 Author Share Posted July 13, 2016 Thanks Lucian, your solution works, but when starting with a StackedColumn or StackedColumnLine plot, the stacking rule applies to each chart type/axis pair. An example would betwo or more measures in a stacked column chart with one axis on the lefttwo ore more measures as lines with one axis on the rightSince plotOptions.stacking applies everywhere, the lines are also stacked. A workaround is to create an additional Y axis for each line since the min and max values are predetermined in our case. However, the extra (third) axis would have to be hidden. Setting yAxis.visible to false doesn't seem to have the desired effect (the axis is still visible).<hc:chartSetting name="yAxis"> <hc:chartProperty name="_jrAxisIndex"> <hc:propertyExpression><![CDATA[2]]></hc:propertyExpression> </hc:chartProperty> <hc:chartProperty name="max"> <hc:propertyExpression><![CDATA[100]]></hc:propertyExpression> </hc:chartProperty> <hc:chartProperty name="min"> <hc:propertyExpression><![CDATA[0]]></hc:propertyExpression> </hc:chartProperty> <hc:chartProperty name="opposite"> <hc:propertyExpression><![CDATA[true]]></hc:propertyExpression> </hc:chartProperty> <hc:chartProperty name="title.text" value=""/> <hc:chartProperty name="visible"> <hc:propertyExpression><![CDATA[false]]></hc:propertyExpression> </hc:chartProperty> </hc:chartSetting>[/code]We can fall back to a regular multi-axis chart but is there a way to achieve the desired result with HTML5 charts? Link to comment Share on other sites More sharing options...
lucianc Posted July 14, 2016 Share Posted July 14, 2016 If the builtin stacked column chart types do not work for you, you can revert to a basic chart type and set the stacking property per series type (e.g. plotOptions.column.stacking) or per individual series using a SeriesProperty contributor. Link to comment Share on other sites More sharing options...
robinm_1 Posted July 14, 2016 Author Share Posted July 14, 2016 perfect Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now