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

Probleme size chart

4 Answers 82 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
GOURVEZ JJ
Top achievements
Rank 1
GOURVEZ JJ asked on 16 Mar 2012, 04:39 PM
Hi,

I use chart and I have problem of size.

My Bars take 2/3 size possible (see file)

Why ?

This is my code :

<Grid.Resources>
<telerik:SeriesMappingCollection x:Key="VerticalMappings2">
  <telerik:SeriesMapping CollectionIndex="0" LegendLabel="inf. ou égale à 0 jours"  >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                            <telerik:StackedBarSeriesDefinition StackGroupName="Stack1">
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings>
                                                    <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/>
                                                </charting:StackedBarSeriesDefinition.LabelSettings>
                                            </telerik:StackedBarSeriesDefinition>
                                        </telerik:SeriesMapping.SeriesDefinition>
   <telerik:ItemMapping DataPointMember="YValue"  />
    </telerik:SeriesMapping>
    <telerik:SeriesMapping CollectionIndex="1" LegendLabel="compris entre 0 et 2 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                            <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings>
                                                    <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/>
                                                </charting:StackedBarSeriesDefinition.LabelSettings>
                                            </telerik:StackedBarSeriesDefinition>
                                        </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="2" LegendLabel="compris entre 2 et 7 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                            <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                        </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="3" LegendLabel="compris entre 7 et 14 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                         <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                    </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="4" LegendLabel="compris entre 14 et 21 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                         <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                    </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="5" LegendLabel="compris entre 21 et 28 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                         <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                    </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="6" LegendLabel="sup. ou égale à 28 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                         <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                    </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                            </telerik:SeriesMappingCollection>
                            <telerik:SeriesMappingCollection x:Key="VerticalMappings">
                                <telerik:SeriesMapping CollectionIndex="0" LegendLabel="inf. ou égale à 0 jours"  >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                            <telerik:StackedBarSeriesDefinition StackGroupName="Stack1">
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                            </telerik:StackedBarSeriesDefinition>
                                        </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue"  />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="1" LegendLabel="compris entre 0 et 2 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                         <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                    </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="2" LegendLabel="compris entre 2 et 7 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                         <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                    </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="3" LegendLabel="compris entre 7 et 14 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                         <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                    </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="4" LegendLabel="compris entre 14 et 21 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                         <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                    </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="5" LegendLabel="compris entre 21 et 28 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                         <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
                                                <charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                    </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                                <telerik:SeriesMapping CollectionIndex="6" LegendLabel="sup. ou égale à 28 jours" >
                                    <telerik:SeriesMapping.SeriesDefinition>
                                         <telerik:StackedBarSeriesDefinition StackGroupName="Stack1" >
                                                <telerik:StackedBarSeriesDefinition.Appearance>
                                                    <telerik:SeriesAppearanceSettings Foreground="Black">
  
                                                    </telerik:SeriesAppearanceSettings>
                                                </telerik:StackedBarSeriesDefinition.Appearance>
<charting:StackedBarSeriesDefinition.LabelSettings> <charting:BarLabelSettings Distance="25" LabelDisplayMode="Auto" ShowConnectors="False"   ShowZeroValueLabels="False"/></charting:StackedBarSeriesDefinition.LabelSettings> </telerik:StackedBarSeriesDefinition>
                                    </telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:ItemMapping DataPointMember="YValue" />
                                </telerik:SeriesMapping>
                            </telerik:SeriesMappingCollection>
                        </Grid.Resources>

And for my chart :

<telerik:RadChart x:Name="RadADVLancementBE" Grid.Row="0" SeriesMappings="{StaticResource VerticalMappings2}" telerik:Theming.Theme="Office_Blue" VerticalAlignment="Top" HorizontalAlignment="Left" Width="90" >
  
                            <telerik:RadChart.DefaultView>
                                <telerik:ChartDefaultView>
                                    <telerik:ChartDefaultView.ChartLegend>
                                        <telerik:ChartLegend Visibility="Collapsed"/>
                                    </telerik:ChartDefaultView.ChartLegend>
                                    <telerik:ChartDefaultView.ChartTitle>
                                        <telerik:ChartTitle Visibility="Collapsed"/>
  
                                    </telerik:ChartDefaultView.ChartTitle>
  
                                </telerik:ChartDefaultView>
                            </telerik:RadChart.DefaultView>
  
  
                        </telerik:RadChart>

Thanks

4 Answers, 1 is accepted

Sort by
0
GOURVEZ JJ
Top achievements
Rank 1
answered on 19 Mar 2012, 09:27 AM
nobody ?
0
Evgenia
Telerik team
answered on 19 Mar 2012, 02:44 PM
Hello,

If you want the chart series to fill the whole available range, you should use StackedBar100 series.  They show the combined contribution of values as percentages where the combined total for each category is 100 percent.

All the best,
Evgenia
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
GOURVEZ JJ
Top achievements
Rank 1
answered on 19 Mar 2012, 02:47 PM
Hi,

thanks for your answer.
But I can't choose StackedBar100 , because my customer refused.

I must use Stack Bar

Thanks
0
Evgenia
Telerik team
answered on 20 Mar 2012, 10:35 AM
Hi Gourvez,

Why don't you provide a custom Yaxis range then? Knowing the Max value for your last bar series added, you may set the MaxValue of the YAxis to be that value. Have in mind that the AutoRange property should be set to false for your manual range to be applied. More information about this can be found in our online documentation.
If you want to keep the automatic range of the YAxis then I would suggest that you set its ExtendDirection property to None. This way your axis won't be extended. You may read more about the property here.

Kind regards,
Evgenia
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Chart
Asked by
GOURVEZ JJ
Top achievements
Rank 1
Answers by
GOURVEZ JJ
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or