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

Formatting Problems

2 Answers 67 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 28 Jul 2011, 12:51 AM

I know this is just me, but I find the Chart control the hardest to grasp.  Something that should be VERY easy is costing me hours to figure out.

I have a stacked bar chart that I want to change the formatting of the numbers on the chart.  By default, my numbers are showing 22k, 56.32k etc.  I want to see the full number such as 22,324 or 12,435,901.  How can I do this?  Here is my XAML:

<telerik:RadChart x:Name="ingestionChart" Grid.Row="3" Grid.Column="4" ItemsSource="{Binding IngestionTotals}" >
                    <telerik:RadChart.DefaultView>
                      <telerik:ChartDefaultView  >
                        <telerik:ChartDefaultView.ChartLegend>
                          <telerik:ChartLegend x:Name="ingestionLegend" Header="Ingestion Filters" UseAutoGeneratedItems="True"/>
                        </telerik:ChartDefaultView.ChartLegend >
                        <telerik:ChartDefaultView.ChartTitle >
                          <telerik:ChartTitle Content="Ingestion Activity" />
                        </telerik:ChartDefaultView.ChartTitle>
                        <telerik:ChartDefaultView.ChartArea>
                        
                          <telerik:ChartArea LegendName="ingestionLegend"  EnableAnimations="True" SmartLabelsEnabled="True"   >
                          </telerik:ChartArea >
                        </telerik:ChartDefaultView.ChartArea>
                      </telerik:ChartDefaultView>
                    </telerik:RadChart.DefaultView>
                    <telerik:RadChart.SeriesMappings>
 
                      <telerik:SeriesMapping  LegendLabel="Available">
                        <telerik:SeriesMapping.SeriesDefinition>
                          <telerik:StackedBarSeriesDefinition StackGroupName="group1" >
                            <telerik:StackedBarSeriesDefinition.LabelSettings >
                              <telerik:BarLabelSettings Distance="10" ShowConnectors="True" LabelDisplayMode="Auto" ShowZeroValueLabels="True" />
                            </telerik:StackedBarSeriesDefinition.LabelSettings>
                            <telerik:StackedBarSeriesDefinition.InteractivitySettings>
                              <telerik:InteractivitySettings HoverScope="Item" SelectionScope="Item" SelectionMode="Single" />
                            </telerik:StackedBarSeriesDefinition.InteractivitySettings>
                          </telerik:StackedBarSeriesDefinition>
                        </telerik:SeriesMapping.SeriesDefinition>
                        <telerik:SeriesMapping.ItemMappings>
                          <telerik:ItemMapping DataPointMember="YValue"  FieldName="Available"   />
                          <telerik:ItemMapping DataPointMember="XCategory" FieldName="Category" />
                        </telerik:SeriesMapping.ItemMappings>
                      </telerik:SeriesMapping>
 
                      <telerik:SeriesMapping  LegendLabel="Label2">
                        <telerik:SeriesMapping.SeriesDefinition>
                          <telerik:StackedBarSeriesDefinition StackGroupName="group1">
                            <telerik:StackedBarSeriesDefinition.LabelSettings>
                              <telerik:BarLabelSettings Distance="10" ShowConnectors="True" LabelDisplayMode="Auto" ShowZeroValueLabels="False"/>
                            </telerik:StackedBarSeriesDefinition.LabelSettings>
                            <telerik:StackedBarSeriesDefinition.InteractivitySettings>
                              <telerik:InteractivitySettings HoverScope="Item" SelectionScope="Item" SelectionMode="Single"/>
                            </telerik:StackedBarSeriesDefinition.InteractivitySettings>
                          </telerik:StackedBarSeriesDefinition>
                        </telerik:SeriesMapping.SeriesDefinition>
                        <telerik:SeriesMapping.ItemMappings>
                          <telerik:ItemMapping DataPointMember="YValue" FieldName="DeNist"  />
                          <telerik:ItemMapping DataPointMember="XCategory" FieldName="Category" />
                        </telerik:SeriesMapping.ItemMappings>
                      </telerik:SeriesMapping>
                 </telerik:RadChart.SeriesMappings>
                  </telerik:RadChart>

2 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 31 Jul 2011, 10:20 PM
Anyone?
0
Missing User
answered on 01 Aug 2011, 01:39 PM
Hi Scott,

RadChart supports both the standard and the custom numeric format expressions, which you can use to format the series items labels, axes labels and tooltip texts. RadChart also supports chart specific format mechanism that allows you to insert context-specific data. For example, you can try with the standard numeric format specifier "N":
<telerik:RadChart x:Name="radChart1">
    <telerik:RadChart.SeriesMappings>
        <telerik:SeriesMapping  LegendLabel="Available">
            <telerik:SeriesMapping.SeriesDefinition>
              <telerik:StackedBarSeriesDefinition ItemLabelFormat="#Y{N0}" StackGroupName="group1" >
                ...
              </telerik:StackedBarSeriesDefinition>
            </telerik:SeriesMapping.SeriesDefinition>
            <telerik:SeriesMapping.ItemMappings>
              <telerik:ItemMapping DataPointMember="YValue"  FieldName="Available"   />
              <telerik:ItemMapping DataPointMember="XCategory" FieldName="Category" />
            </telerik:SeriesMapping.ItemMappings>
        </telerik:SeriesMapping>
        ...
    </telerik:RadChart.SeriesMappings>
    ...
</telerik:RadChart>

For additional information on Format Expressions, please refer to the following online resources:
http://www.telerik.com/help/silverlight/radchart-features-format-expressions.html
http://www.telerik.com/help/silverlight/radchart-features-chart-area.html

I hope that this information helps.

All the best,
Polina
the Telerik team

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

Tags
Chart
Asked by
Scott
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Missing User
Share this question
or