Jump to content
Software FX Community

poonwahj

Members
  • Posts

    2
  • Joined

  • Last visited

poonwahj's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. poonwahj

    ChartView

    I noticed in another post that the ChartView was supposed to add support for ViewModel databinding to the series property on the Chart. This would be helpful for people authoring controls where the user can select which columns to visualize on the chart. I, however, have not found any real information on how to do this. I'm looking to databind to the X,Y and series properties of a chart, <cfx:ChartView x:Name="chart1" ItemsSource="{Binding Path=DataSource}" Gallery="Bar"> <cfx:ChartView.Series> <cfx:SeriesAttributes BindingPath="{Binding Path=Series1Column}" /> <cfx:SeriesAttributes BindingPath="{Binding Path=Series2Column}" /> </cfx:ChartView.Series> <cfx:ChartView.AxisX> <cfx:Axis AutoScale="True" DataPath="{Binding Path=XAxis}" /> </cfx:ChartView.AxisX> <cfx:ChartView.AxisY> <cfx:Axis AutoScale="True" DataPath="{Binding Path=YAxis}"/> </cfx:ChartView.AxisY> </cfx:ChartView> Although, it probably makes sense to have no YAxis value (Because that will be calculated automagically by the Series Values). This code doesn't work. How does one bind, in this way, to the Series Binding path, or even the SeriesAttributes object in a ViewModel? JP
  2. I'm trying to bind a set of data from an MVVM type project to a ChartView that is completely constructed in Xaml. Our architecture requires that we are able to change which values are bound to which two series, which values to use for the X axis, and which values are used for the Y axis. I have view models exposing strings for the selected values (Series1, Series2, X, Y) which are detected in code by the ChartView's ItemSource which is bound to the DataSet exposed by the ViewModel, like so: <cfx:ChartView x:Name="chart1" ItemsSource="{Binding Path=DataSource}" Gallery="Bar"> <cfx:ChartView.Series> <cfx:SeriesAttributes BindingPath="{Binding Path=Series1Column}" /> <cfx:SeriesAttributes BindingPath="{Binding Path=Series2Column}" /> </cfx:ChartView.Series> <cfx:ChartView.AxisX> <cfx:Axis AutoScale="True" DataPath="{Binding Path=XAxis}" /> </cfx:ChartView.AxisX> <cfx:ChartView.AxisY> <cfx:Axis AutoScale="True" DataPath="{Binding Path=YAxis}"/> </cfx:ChartView.AxisY> </cfx:ChartView> This obviously doesn't work, but maybe you can see what I'm trying to do. Is this possible in Xaml? Am I on the right track?
×
×
  • Create New...