I have got a problem to update a winchart when the number of data for the X-Axis change.
I use chart to show the evolution of a measure according to time. When the period of data changes the graph is updating but keeps the same space for the X-Axis. If I reduce the period the chart is smaller and if I increase the periode the chart is bigger and I do not see the end of the measure.
this.ultraChartCourbes.DataBind();
I try to ultraChartCourbes.ResetData before connect data, but it changes nothing.
If you want I can send you printscreen of my program
thanks
Not sure if i can even give you a good guess on this one. We never really tested our win controls in WPF, though they're assumed to just work. Both approaches sound valid to me. Can you describe your scenario a bit further. Maybe we can try reproducing this in a sample that's closer to what you're doing.
Max, thanks for your reply.
As a priority customer a colleague (Matt) of yours emailed me a test app, this did indeed worked but I had an outstanding question as to why it worked. Briefly:
The architecture that I put forward initiialised the datasource on the WinForms component and then left responsibility of data update with the WinForms component, with a message to do so coming from the WPF host, for example a button click. Matt's test app pushed data from the WPF onto the WinForms component; this worked but I don't see why my solution wouldn't have either? Are you able to shed some light on it at all?
Thanks
Steve
Have you tried reassigning the datasource?
<Grid Name="grid"> <Grid.RowDefinitions> <RowDefinition Height="4*"/> <RowDefinition/> </Grid.RowDefinitions> <Button Click="Button_Click" Grid.Row="1" Content="click"></Button> <wf:WindowsFormsHost> <winchart:UltraChart x:Name="Chart"/> </wf:WindowsFormsHost></Grid>
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) Me.Chart.Data.DataSource = table1End Sub
Private Sub Button_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Me.Chart.Data.DataSource = table2End Sub
Max, hi thereI have a similar problem wiht the implementation of WinChart (ver 9.1).
This idea is simple, call a different data source on a chart.
The data is dynamically generated from a spreadsheet table; when the spreadsheet is changed via some other user interaction, a new table is created and the chart should be redrawn.
I've tried the various chart Resetxxx methods, invalidate and invalidatelayers methods, however the chart isn't changing.
The chart is 3D and will sometimes be 2D as the ultimate goal for the app is user data choice and use chart choice (data availability depending of course)
Would appreciate your thoughts and snippet if possible. I'm using VB and WPF.
You see a library is created from IGs WinChart (I don't like the WPF version at the moment) and then hosted inside a WPF App. The WPF app gathers the user data and sends to the WinChart. It all works well with the exception of the data updating.
TIA
Try calling Invalidate() or InvalidateLayers() on your chart. If this doesn't work make sure you're not using a custom range on your x axis (such as chart.Axis.X.RangeType = custom). If that doesn't work, please provide more detail about the chart type and the data being bound. Sample code would help the most.