Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
Problem with XamWebChart
posted

I am trying to build a simple chart that graphs amount of powner used over time.  I must be missing something very obvious because its not working.  I have bound my graph to the observable collection (which has hard coded values in it in the constructor just for testing), set the datamapping..no data.  I added axis...still not working.  I wanted to do this via scatter line, but I just get the warning about setting parameters (which I do, but it doesn't work).  I know I am just missing something.  Here is the xaml:

  <igChart:XamWebChart Margin="0,0,0,0" DataContext="{Binding PowerPerHour, Source={StaticResource PowerPerHourDataSource}}">
   <igChart:XamWebChart.Axes>
    <igChart:Axis DataContext="{Binding Path=TimeStamp, Mode=OneWay}" x:Name="AxisX"/>
    <igChart:Axis DataContext="{Binding Path=AmountOfPower, Mode=OneWay}" x:Name="AxisY" AxisType="PrimaryY" AutoRange="False" Maximum="3800" Minimum="2000" Unit="250"/>
   </igChart:XamWebChart.Axes>
   <igChart:XamWebChart.Series>
    <igChart:Series ChartType="Line" AxisX="AxisX" AxisY="AxisY"
        DataMapping="ValueX=Timestamp; ValueY=AmountOfPower"
        DataSource="{Binding Path=PowerPerHour, Mode=OneWay}" Label="Power Per Hour"/>
   </igChart:XamWebChart.Series>
  </igChart:XamWebChart>

The observable collection exposes a ObservableCollection<PowerDataPoint>

Where PowerDataPoint exposes two fields:

public DateTime Timestap { get;; set; }

public double AmountOfPower { get; set; }

Anybody that could help I would apprieciate it.

Thanks