Chart and Collection of objects

5 posts, 0 answers
  1. GM72
    GM72 avatar
    23 posts
    Member since:
    Sep 2012

    Posted 28 Jan 2010 Link to this post

    Hi,

    I am setting the itemssource to a custom collection. This is great as works well.

    I am just trying to fine tune things a bit:

    How do I change the x axis values (ie it uses numbers but I want it to use the property name Status)??
    As it is calling a wcf service there is a slight lag from the wcf - is there an easy way i can stop the no data series from displaying.??

    I have tried the help but I can't find anything obvious.

    Thanks
  2. GM72
    GM72 avatar
    23 posts
    Member since:
    Sep 2012

    Posted 28 Jan 2010 Link to this post

    I've worked out the item mappings but I can't find out how to format my x axis labels (they are too large so overlap)... any ideas
  3. DevCraft banner
  4. Nathan
    Nathan avatar
    24 posts
    Member since:
    Sep 2009

    Posted 28 Jan 2010 Link to this post

    Hey Graeme,

    I ran into similar issues since my x axis names are too long to fit very nicely in a chart. Also they default as centered and I haven't found the properties I'm looking for to format those labels or alignment yet. 

    What I did in the meantime was to put the names of the data points as tool tip text instead.

    Just ran across an example of how to style the bar (and series labels) in xaml:
    http://demos.telerik.com/silverlight/#Chart/NegativeValues
  5. GM72
    GM72 avatar
    23 posts
    Member since:
    Sep 2012

    Posted 29 Jan 2010 Link to this post

    Nathan,

    Cheers for the reply.

    I found the label rotation property was good enough for what I needed to do (once i'd worked out that it was the default view I needed to manipulate!) chart.defaultview.chartarea.axisx.labelrotationangle =45. Don't know if this helps you.

    The only thing I need to work out now is how to stop the no data from showing while my wcf service is getting the data... i'm guessing that'll be somewhere in the default view too!

    Thanks
  6. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 03 Feb 2010 Link to this post

    Hi Graeme,

    The best way is to simply re-template the NoDataControl, setting empty template:
    <Style x:Key="noDataControl" TargetType="telerikCharting:NoDataControl">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate />
        </Setter.Value>
      </Setter>
    </Style>

    Then, in the code-behind set:
    this.RadChart1.DefaultView.ChartArea.NoDataControlStyle = this.LayoutRoot.Resources["noDataControl"] as Style;

    Best,
    Evtim
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Back to Top
DevCraft banner