bskidan Posted November 4, 2009 Report Share Posted November 4, 2009 I'm populating chart with some data based on user selection. Data values ranges are different for each user selection. When simple chart is configured without explicit AxisY it works fine, changing scale up or down to fit the actual values: <cfx:Chart Name="_dataChart"> <cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="SeriesA" Content="Series A" Gallery="Area"/> </cfx:Chart.Series> </cfx:Chart> But if I specify AxisY to format labels the the scale grows to accommodate larger values but never shrinks: <cfx:Chart Name="_dataChart"> <cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="SeriesA" Content="Series A" Gallery="Area"> <cfx:SeriesAttributes.AxisY> <cfx:Axis> <cfx:Axis.Labels> <cfx:AxisLabelAttributes Format="Currency"/> </cfx:Axis.Labels> </cfx:Axis> </cfx:SeriesAttributes.AxisY> </cfx:SeriesAttributes> </cfx:Chart.Series> </cfx:Chart> I'm attaching fully working solution to demonstrate the problem. Thanks. Quote Link to comment Share on other sites More sharing options...
bskidan Posted November 6, 2009 Author Report Share Posted November 6, 2009 Ok, found this one myself. Instead of specifying Axis inside SeriesAttributes element I've created an aixis on the chart level and only referenced the existing axis from my series: <cfx:Chart Name="_dataChart" Style="{x:Static cfxmotifs:Basic.Style}"> <cfx:Chart.AxesY> <cfx:Axis Position="Near"> <cfx:Axis.Labels> <cfx:AxisLabelAttributes BindingPath="SeriesA" /> </cfx:Axis.Labels> </cfx:Axis> </cfx:Chart.AxesY> <cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="SeriesA" Content="Series A" Gallery="Area" cfx:Axis.Index="0"/> </cfx:Chart.Series> </cfx:Chart> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.