Jump to content
Software FX Community

vladvm

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by vladvm

  1. Hello, I have a pie chart bound to a observable collection of some data objects. Chart Series is bound to a property of this data object. When I add new object into collection chart gets updated, but when I change value of the property that is bound to the series - it is not reflected in the chart. Is it by design or just some oversight in the current version? Or there is another way to get the result I want? Thank you! Here is an example: public class Venue : DependencyObject { public Venue() { } public static readonly DependencyProperty NameProperty = DependencyProperty.Register("Name", typeof(string), typeof(Venue), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender)); public string Name { get { return (string)GetValue(NameProperty); } set { SetValue(NameProperty, value); } } public static readonly DependencyProperty PercentProperty = DependencyProperty.Register("Percent", typeof(double), typeof(Venue), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender))); public double Percent { get { return (double)GetValue(PercentProperty); } set { SetValue(PercentProperty, value); } }} <Window.Resources> <local:Venues x:Key="selectedVenues"/> </Window.Resources> <Grid> <ChartFX:Chart x:Name="distChart" Style="{DynamicResource chartStyle}" Background="LightGray" Gallery="Pie" ItemsSource="{Binding Source={StaticResource selectedVenues}}"> <ChartFX:SeriesAttributes BindingPath="Percent" > </ChartFX:SeriesAttributes> </ChartFX:Chart> </Grid>
  2. Thank you, JuanC! I have tried all three options and only the third one worked. The first one didn't compile because AxisLabelAttributes was not found in the ChartFX assembly (the version I use is 0.8.2957.30556). And moreover Axis.Labels seems to be read-only property. Is there a newer version? The second option didn't work because of the binding exception: System.Windows.Data Error: 38 : BindingExpression with XPath cannot bind to non-XML object.; XPath='@Label' BindingExpression:Path=/InnerText; DataItem='String' (HashCode=1193620881); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String') Point 5 Do I need to specify DataContext explicitly? And the third option works just fine, but it doesn't support highlighting functionality when I hover over the chart. Actually I can still trigger highlighting when I hover over the legeng box items, but they do not dim as they used to (thre chart itself does dim still). How can I get this feature back? Thanks again for the quick reply and nice product! VladVM. P.S. Is it possible to get an updated version of the library?
  3. I tried most of the suggestions writen here, but all I can see changing is tooltip, but not the LegendBox items. I still see those as Point 1, Point 2 etc... or nothing at all. How can I change those 'Point n' in the LegendBox to something meaningful? Here is my xaml. I would like to see content of the 'Label' data element in the LegendBox. How can I do that? <XmlDataProvider x:Key="myXmlData" XPath="ChartPoints/Point"> <x:XData> <ChartPoints xmlns=""> <Point Value="5" Label="Consumer" /> <Point Value="7" Label="Energy"/> <Point Value="4" Label="Technology"/> <Point Value="3" Label="Healthcare"/> <Point Value="7" Label="Financial" /> </ChartPoints> </x:XData> </XmlDataProvider> <ChartFX:Chart x:Name="chart1" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" PointCount="5" Gallery="Pie" Background="Transparent" BorderThickness="0" ItemsSource="{Binding Source={StaticResource myXmlData}}"> <ChartFX:Chart.LegendBox> <ChartFX:LegendBox Visibility="Visible" > </ChartFX:LegendBox> </ChartFX:Chart.LegendBox> <ChartFX:SeriesAttributes BindingPath="@Value" /> </ChartFX:Chart> Thank you!
×
×
  • Create New...