I was wondering if there was a way to get a callback on when a visifire chart is done rendering. I've been trying to create a chart and save it the image. This works with a button press, but does not work if I do it without the button. My guess is because the chart is not done loading, but I'm not so sure. When the page gets loaded, I set the ObservableCollection values that are used in my XAML.
I basically have a few data series that looks like this:
<vc:Chart.Series>
<vc:DataSeries RenderAs="StackedColumn" LegendText="Portion sequenced" LightingEnabled="False" AxisYType="Primary" Color="#4198AF" DataSource="{Binding SequencedValues}">
<vc:DataSeries.DataMappings>
<vc:DataMapping MemberName="AxisXLabel" Path="Key"></vc:DataMapping>
<vc:DataMapping MemberName="YValue" Path="Value"></vc:DataMapping>
</vc:DataSeries.DataMappings>
These get populated by the ObservableCollection. So I first call my method DrawImage() to set the observablecollection values, then I call Save(). Like I said, the Save() method works on its own with a button press, but does not if I call it after I draw the image. I thought it initially had to do with the page not finished loading yet. But using
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding PageLoadCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
I only call DrawImage() and Save() when the page is loaded. I even tried putting a sleep timer for 5 seconds between DrawImage() and Save() just to see if there was a timing problem and I still only get my background image, but nothing with my DataSeries.
So my question is if there's a way to get called back after the Visifire chart loads, or if there is another solution I'm missing. Thanks.