Legends is not showing up

7 posts, 1 answers
  1. Pedro
    Pedro avatar
    3 posts
    Member since:
    Jun 2012

    Posted 11 Jun 2012 Link to this post

    see attached file...
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 12 Jun 2012 Link to this post

    Hi Pedro,

    After looking at your chart, I can see where your problem lies. If you take a closer look at the two items that have the yellow tops, the total amount added in the bar is only 30.

    All your other bars have 31 as a total value and therefore have no room left. So what is happening? The chart is making up for the remaining value of 1 with the yellow section.

    Also, you may want to adjust your Y-Axis to have a max value of 31. As it is now, you have a value of 100 which does not represent your bars' values.

    I hope this answer clears things up for you. If it does not, please tell me a bit more on what you are trying to achieve, a single image is difficult to ascertain what your goals are.

    Good Luck!
    Lancelot
  3. DevCraft banner
  4. Pedro
    Pedro avatar
    3 posts
    Member since:
    Jun 2012

    Posted 19 Jun 2012 Link to this post

    Hi Lancelot,
    Thanks for the reply, but the problem is that these values ​​are dynamic. See this other example.
  5. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 20 Jun 2012 Link to this post

    Hi Pedro,

    Thank you for providing another image. It is hard to really determine what is going without your actual code, however in this new image it appears that label for the value is not being shown because there is not enough room left to display the label.

    For instance, all the other gray values are displayed because there is room between the end of the blue range and the top of the chart. In columns 1,2 and 4 there is no room left over. Except for the first category (green), the label will appear in its own section of the bar. So if you have a value that is a few percent and at the top of the chart, the label wont display.

    You could create your own custom Style for the ItemLabel you can find instructions on that here, but you may end up needed to edit the entire control template to allow the value to show even when there is no room. This link will bring you to the Styling Overview for the entire RadChart. To learn how to extract the entire control template, this link will demonstrate that for you.

    Good Luck
    Lancelot

  6. Answer
    Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 21 Jun 2012 Link to this post

    Hello Pedro,

    Thank you for the attached screenshots. You can try to disable the smart labels:
    this.chart1.DefaultView.ChartArea.SmartLabelsEnabled = false;

    Also for the last series you can set the LabelDisplayMode to Inside:
    <telerik:StackedBar100SeriesDefinition>
     <telerik:StackedBar100SeriesDefinition.LabelSettings>
      <telerik:BarLabelSettings LabelDisplayMode="Inside" />

    Instead of the LegendDisplayMode you may also set a series item label style with a margin:
    <telerik:StackedBar100SeriesDefinition>
     <telerik:StackedBar100SeriesDefinition.SeriesItemLabelStyle>
      <Style TargetType="telerik:SeriesItemLabel">
       <Setter Property="Margin" Value="0 7 0 0" />

    I have attached a simple project to demonstrate the suggestions.

    All the best,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. Pedro
    Pedro avatar
    3 posts
    Member since:
    Jun 2012

    Posted 21 Jun 2012 Link to this post

    Hello Petar,

    Thank you so much, using this option "<telerik:BarLabelSettings LabelDisplayMode="Inside" />". The values ​​were superimposed see (fig1.png).
    I decided as follows(see test_hist.png):
    seriesDefinition.LabelSettings.LabelDisplayMode = LabelDisplayMode.Outside;
    seriesDefinition.LabelSettings.Distance = 0d;

    Pedro.
  8. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 22 Jun 2012 Link to this post

    Hello Pedro,

    My suggestion was to set the display mode to Inside only for the last series. Give this a try and see if you like the results. 

    Greetings,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner