wpf - LinearAxis without decimal numbers -


i want avoid decimal numbers in axis, how can ?

enter image description here

xaml:

 <charting:chart   verticalalignment="stretch"                  horizontalcontentalignment="stretch">          <charting:chart.axes>             <charting:linearaxis  orientation="y" minimum="0" title="" location="left"                     />         </charting:chart.axes>          <charting:chart.series>              <charting:columnseries itemssource="{binding persons}"                         dependentvaluebinding="{binding count}"                         independentvaluebinding="{binding category}">             </charting:columnseries>         </charting:chart.series>     </charting:chart> 

in case you're still struggling on this, or if else interested: solution baalazamon wrote. it's {0:0.##} display 2 decimal digits if exists (that's ".##" means). should write is

<style x:key="emptystyle" targettype="charting:numericaxislabel">      <setter property="istabstop" value="false" />      <setter property="stringformat" value="{0:0}" />      <setter property="template">          <setter.value>              <controltemplate targettype="charting:numericaxislabel">                  <textblock />              </controltemplate>          </setter.value>      </setter>  </style> 

and of course need add this:

<charting:lineseries.dependentrangeaxis>             <charting:linearaxis axislabelstyle="{staticresource emptystyle}"                 orientation="y"                 showgridlines="true"/>     </charting:lineseries.dependentrangeaxis> 

i hope solve problem.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -