This is a migrated thread and some comments may be shown as answers.

Legends is not showing up

6 Answers 74 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Pedro
Top achievements
Rank 1
Pedro asked on 11 Jun 2012, 09:22 PM
see attached file...

6 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 12 Jun 2012, 10:16 PM
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
0
Pedro
Top achievements
Rank 1
answered on 19 Jun 2012, 05:18 PM
Hi Lancelot,
Thanks for the reply, but the problem is that these values ​​are dynamic. See this other example.
0
Lancelot
Top achievements
Rank 1
answered on 20 Jun 2012, 10:07 PM
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

0
Accepted
Petar Marchev
Telerik team
answered on 21 Jun 2012, 08:32 AM
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 >>

0
Pedro
Top achievements
Rank 1
answered on 21 Jun 2012, 02:15 PM
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.
0
Petar Marchev
Telerik team
answered on 22 Jun 2012, 06:03 AM
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 >>

Tags
Chart
Asked by
Pedro
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Pedro
Top achievements
Rank 1
Petar Marchev
Telerik team
Share this question
or