Jump to content
Software FX Community

justin.katz

Members
  • Posts

    3
  • Joined

  • Last visited

justin.katz's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Francisco, Thanks for the quick post. This would be a great solution if my data were in tabular format; unfortunately my data is already organized into a set of hierarchical data. Here is another example to better illustrate my situation: Stock - Has many value/time Points in a List ClientPortfolio - Has many Stock objects in a List I want to display one Chart, with a Series for each Stock over time in the ClientPortfolio. Ideally, I would set the Chart's data source to be the ClientPortfolio object, and it would automatically generate as many Series as necessary. This is synonymous with display hierarchical data with a TreeView. Thanks, Justin
  2. This may be a basic data binding question, but i'm having difficulty getting this accomplished. My goal is to have a Chart bind to my data object, and display as many SeriesAttributes as necessary to show all the data. For example, assume the Chart is displaying a stock portfolio with an arbitrary number of stocks. For each stock, I want a series shown to represent its price over time. As my StockPortfolio object is updated during runtime (stocks added, removed, quantity changed etc), I want the Chart's series'es to update to match. Is this possible via binding, or do I need to resort to accomplishing this programatically? I have attached a project that shows my failed attempt at binding. Any help would be greatly appreciated! Thanks, Justin Katz
  3. I've encountered a problem where a ConditionalAttribute on my Chart works fine when the Chart is defined in the normal body of the Xaml. The ConditionalAttributes are completely ignored when used on a Chart defined in a DataTemplate though. Working and non-working examples are shown below, and suggestions would be appreciated. <Window x:Class="ChartFXSandbox.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cfx="clr-namespace:ChartFX.WPF;assembly=ChartFX.WPF" Title="ChartFXSandbox" Height="800" Width="1024" > <Window.Resources> <XmlDataProvider x:Key="ChartData" XPath="/Coordinates/Coordinate"> <x:XData> <Coordinates xmlns=""> <Coordinate> <Domain>1</Domain> <Range>2</Range> </Coordinate> <Coordinate> <Domain>2</Domain> <Range>4</Range> </Coordinate> <Coordinate> <Domain>3</Domain> <Range>6</Range> </Coordinate> <Coordinate> <Domain>4</Domain> <Range>8</Range> </Coordinate> <Coordinate> <Domain>5</Domain> <Range>10</Range> </Coordinate> </Coordinates> </x:XData> </XmlDataProvider> <DataTemplate x:Key="ChartDataTemplate" DataType="ChartData"> <cfx:Chart ItemsSource="{Binding Source={StaticResource ChartData}}" Gallery="Line"> <cfx:SeriesAttributes BindingPath="Range" BindingPathX="Domain"/> <cfx:Chart.ConditionalAttributes> <cfx:ConditionalAttributes Fill="Blue"> <cfx:ConditionalAttributes.Condition> <cfx:RangeCondition From="3" To="9" BindingPath="Range"/> </cfx:ConditionalAttributes.Condition> </cfx:ConditionalAttributes> </cfx:Chart.ConditionalAttributes> </cfx:Chart> </DataTemplate> </Window.Resources> <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <ContentControl Grid.Row="0" Content="{Binding Source={StaticResource ChartData}}" ContentTemplate="{StaticResource ChartDataTemplate}" /> <ContentControl Grid.Row="1"> <cfx:Chart ItemsSource="{Binding Source={StaticResource ChartData}}" Gallery="Line"> <cfx:SeriesAttributes BindingPath="Range" BindingPathX="Domain"/> <cfx:Chart.ConditionalAttributes> <cfx:ConditionalAttributes Fill="Blue"> <cfx:ConditionalAttributes.Condition> <cfx:RangeCondition From="3" To="9" BindingPath="Range"/> </cfx:ConditionalAttributes.Condition> </cfx:ConditionalAttributes> </cfx:Chart.ConditionalAttributes> </cfx:Chart> </ContentControl> </Grid></Window>
×
×
  • Create New...