How about my second question? Is there a way to place values on top of the bars?
How would I do that? Does that mean I have to modify the chart template with a hundred lines of code?
<chartingToolkit:Chart ..............> <chartingToolkit:Chart.Title> <StackPanel Orientation="Horizintal"> <TextBlock Text="{Binding ........}" /> <TextBlock Text="{Binding ........}" /> </StackPanel> </chartingToolkit:Chart.Title> ......
<toolkit:Chart Title="{Binding [tcmlatestcounts._STREET+tcmlatestcounts._FROM]}" FontWeight="Bold" Width="800" Height="400">
However, I would still like to remove the legend box.
Also, is there a work around for not being able to use a number as the Name? The underscore is unsightly.
<esri:FeatureLayer.MapTip> <Border Style="{StaticResource PanelBorder}"> <Border.Resources> <sys:Int32 x:Key="zero">0</sys:Int32> <ListBox x:Name="Counts"> <ListBoxItem Name="_1998" Content="{Binding [tcmlatestcounts._1998], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_1999" Content="{Binding [tcmlatestcounts._1999], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2000" Content="{Binding [tcmlatestcounts._2000], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2001" Content="{Binding [tcmlatestcounts._2001], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2002" Content="{Binding [tcmlatestcounts._2002], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2003" Content="{Binding [tcmlatestcounts._2003], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2004" Content="{Binding [tcmlatestcounts._2004], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2005" Content="{Binding [tcmlatestcounts._2005], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2006" Content="{Binding [tcmlatestcounts._2006], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2007" Content="{Binding [tcmlatestcounts._2007], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2008" Content="{Binding [tcmlatestcounts._2008], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2009" Content="{Binding [tcmlatestcounts._2009], TargetNullValue={StaticResource zero}}" /> <ListBoxItem Name="_2010" Content="{Binding [tcmlatestcounts._2010], TargetNullValue={StaticResource zero}}" /> </ListBox> </Border.Resources> <toolkit:Chart Title="Historical Counts" FontWeight="Bold" Width="800" Height="400"> <toolkit:Chart.Axes> <toolkit:CategoryAxis Orientation="X" Title="Year" /> <toolkit:CategoryAxis Orientation="Y" Title="ADT" /> </toolkit:Chart.Axes> <toolkit:Chart.Series> <toolkit:ColumnSeries Title="ADT" IndependentValueBinding="{Binding Name}" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource Counts}, Path=Items}" /> </toolkit:Chart.Series> </toolkit:Chart> </Border> </esri:FeatureLayer.MapTip>
<esri:FeatureLayer.MapTip> <Border Background="Pink"> <Border.Resources> <sys:Int32 x:Key="zero">0</sys:Int32> <ListBox x:Name="_1998"> <ListBoxItem Content="{Binding [tcmlatestcounts._1998], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_1999"> <ListBoxItem Content="{Binding [tcmlatestcounts._1999], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2000"> <ListBoxItem Content="{Binding [tcmlatestcounts._2000], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2001"> <ListBoxItem Content="{Binding [tcmlatestcounts._2001], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2002"> <ListBoxItem Content="{Binding [tcmlatestcounts._2002], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2003"> <ListBoxItem Content="{Binding [tcmlatestcounts._2003], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2004"> <ListBoxItem Content="{Binding [tcmlatestcounts._2004], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2005"> <ListBoxItem Content="{Binding [tcmlatestcounts._2005], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2006"> <ListBoxItem Content="{Binding [tcmlatestcounts._2006], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2007"> <ListBoxItem Content="{Binding [tcmlatestcounts._2007], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2008"> <ListBoxItem Content="{Binding [tcmlatestcounts._2008], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2009"> <ListBoxItem Content="{Binding [tcmlatestcounts._2009], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="_2010"> <ListBoxItem Content="{Binding [tcmlatestcounts._2010], TargetNullValue={StaticResource zero}}" /> </ListBox> </Border.Resources> <!--<TextBlock Text="{Binding [tcmlatestcounts._1998]}" Foreground="Black" />--> <toolkit:Chart Title="Historical Counts" Width="800"> <toolkit:Chart.Axes> <toolkit:CategoryAxis Orientation="X" Foreground="Transparent" /> </toolkit:Chart.Axes> <toolkit:Chart.Series> <toolkit:ColumnSeries Title="1998" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _1998}, Path=Items}" /> <toolkit:ColumnSeries Title="1999" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _1999}, Path=Items}" /> <toolkit:ColumnSeries Title="2000" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2000}, Path=Items}" /> <toolkit:ColumnSeries Title="2001" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2001}, Path=Items}" /> <toolkit:ColumnSeries Title="2002" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2002}, Path=Items}" /> <toolkit:ColumnSeries Title="2003" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2003}, Path=Items}" /> <toolkit:ColumnSeries Title="2004" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2004}, Path=Items}" /> <toolkit:ColumnSeries Title="2005" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2005}, Path=Items}" /> <toolkit:ColumnSeries Title="2006" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2006}, Path=Items}" /> <toolkit:ColumnSeries Title="2007" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2007}, Path=Items}" /> <toolkit:ColumnSeries Title="2008" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2008}, Path=Items}" /> <toolkit:ColumnSeries Title="2009" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2009}, Path=Items}" /> <toolkit:ColumnSeries Title="2010" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource _2010}, Path=Items}" /> </toolkit:Chart.Series> </toolkit:Chart> </Border> </esri:FeatureLayer.MapTip>
Binding b2 = new Binding("");MyDictionaryConverter dc2 = new MyDictionaryConverter();b2.Converter = dc2;
Is possible to insert a combobox inside a cell of a DataGrid?,
private void ckbVisibility_Checked(object sender, RoutedEventArgs e) { CheckBox ckb = sender as CheckBox; TocItem data = ckb.DataContext as TocItem; if (ckb.Tag.ToString().ToLower() == "new") { ckb.Tag = ""; data.ItemChecked += _itemChecked; } }
public sealed class MyDictionaryConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var dict = value as IDictionary<string, object>; if (dict != null) { if (dict.ContainsKey(parameter as string)) return dict[parameter as string]; } return 0; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotSupportedException(); } }
What Should I refresh after it?
In the same case (kastofan chart) if the value of the field TEL_TOT in the database is null, the application is giving an error (attaching it).Is there a possibility to prevent that? or control it?
<Border.Resources> <sys:Int32 x:Key="zero">0</sys:Int32> <ListBox x:Name="Telephones"> <ListBoxItem Content={Binding [TEL_TOT], TargetNullValue={StaticResource zero}}" /> </ListBox> <ListBox x:Name="Mobiles"> <ListBoxItem Content={Binding [MOB_TOT], TargetNullValue={StaticResource zeo}}" /> </ListBox> <ListBox x:Name="Internets"> <ListBoxItem Content={Binding [INT_TOT], TargetNullValue={StaticResource zero}}" /> </ListBox> </Border.Resources>
is there the possibility to take out the number "1" that is in the bottom?, is there a property to configure the x-axis label or something like that?
<chartingToolkit:Chart Title="Communication" > <chartingToolkit:Chart.Axes> <chartingToolkit:CategoryAxis Orientation="X" Foreground="Transparent" /> </chartingToolkit:Chart.Axes> ....
First problem: txtProd is null when I try to add a binding by code.
TextBlock txtBlock = ChartFeaturelayer.MapTip.FindName("txtProd") as TextBlock;
Second Problem:If I try creating a new TextBlock instance and changing the binding like this code below, it doesn't work:FeatureLayer ChartFeaturelayer = MyMap.Layers["ChartFL"] as FeatureLayer;ChartFeaturelayer.OutFields.Add("NEWFIELD"]);txtIDChart = new TextBlock(); Binding b = new Binding("");b.Mode = BindingMode.OneWay;b.ConverterParameter = "NEWFIELD";txtIDChart.SetBinding(TextBlock.TextProperty, b);
b.Converter = new DictionaryConverter();
Binding b = new Binding("[NEWFIELD]");
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.