Jump to content
Software FX Community

AutoScale doesn't shrink when AxisY is specified for SeriesAttributes


bskidan

Recommended Posts

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.

 

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...