Jump to content
Software FX Community

Refresh Chart


Rolf.Eisenhut

Recommended Posts

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

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

  • 7 months later...

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...