Rolf.Eisenhut Posted January 20, 2008 Report Share Posted January 20, 2008 How can i refresh the chart properly? Actually i prepare the chart by setting the itemsource in Code behind after Initializing. And then call Refresh of the chart. That works fine. In the Program i have a toggle buttom for switching ItemSources and activating more series (switching from hidden to visible). Then a call refresh. The refresh do not work. If i call Refresh again then it works. >>> is there a bug ? Regards Rolf Link to comment Share on other sites More sharing options...
JuanC Posted January 25, 2008 Report Share Posted January 25, 2008 Actually anytime you have to call refresh (even once) we consider it a bug, the function is there to allow you to workaround the issue where changing one or more properties is not reflected on the chart but we would like to fix as many as those as possible. We will test the scenario you described, if you can send a small sample showing the issue it would be appreciated. Regards, JuanC Link to comment Share on other sites More sharing options...
bobt Posted August 25, 2008 Report Share Posted August 25, 2008 I have a similar situation in which series may be visible or invisible. Once the chart is first viewed, the user may select more series using a context menu, after which control returns to the original chart. What I observe is this: 1) when all the series are removed, then chart reflects this scenario with the "No Data" message. So far, so good. 2) when all the series are added, the chart paints and shows the x and y axis, legend, and so on, but none of the individual lines show up. The plot does show when the data is initially loaded using InitPlot. The relevant methods are below. Am I missing another call to setup the Chart on a repaint? Thoughts? Thanks, BobT private void Reset() { MyChart.Series.Clear(); } private void Refresh() { MyChart.Refresh(); } private void ChartMenuItem_Click(object sender, RoutedEventArgs e) { HeaderedItemsControl hic = (HeaderedItemsControl) sender; if (hic.Header.Equals("Select Curve")) { SelectCurveFamilyDialog scfd = new SelectCurveFamilyDialog(); scfd.DataContext = new CurveFamilyDataSet(GetPlot().CurveFamilies); if (scfd.ShowDialog() == true) { // refresh plot Reset(); InitPlot(); Refresh(); } // else? } } private void InitPlot() { PlotData plot = GetPlot(); if (plot != null) { // spin over visible plot curve families foreach (CurveFamilyData curveFamily in plot.CurveFamilies) { if (curveFamily.IsVisible.BoolValue) { AddCurveFamily(curveFamily); } } InitLegend(); } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.