Jump to content
Software FX Community

bobt

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by bobt

  1. Here is the general template... Reset(); // calls Chart.Series.Clear() InitPlot(); // programmatically binds to DataContext since it can hold arbitrary number of series Refresh(); // calls Chart.Refresh() In my Reset() method, I perform a Chart.Series.Clear() operation. I added a button and event handler to perform the increment and title set operations you described and this works as long as I do not previously clear the series data in the Reset(). I understand that the Series represents the underlying chart data, and it appears that there is an dependency event fired when the Series.Count == 0 because I wrote a loop to emulate Series.Clear and the effect was the same. The legend appears just fine as do the series of points upon reset/reinit/refresh. But is there a way to pin both the x- and y- axis? Many Thanks, Bob
  2. As part of a chart Reset/ReInit/Refresh operation, I have written code to programmatically set the Axis.Title.Content property to a new value. The dynamic title works fine on the first pass or layout chart, but upon user chosen operation and chart refresh, the axis title does not show. I inspected the Content and Visibility property variables before refresh at runtime using the debugger, and there are indeed appropriate values. I perform the refresh using the Chart.Refresh() method. Is there another property I must set before refresh? Thoughts? Hints? Tips? Thanks, Bishr
  3. Try the SeriesAttribute.Content property.
  4. Must one obtain the Go Live license so that developers need not run the Beta 2 installer? There are no compile time errors since there are project-level references to ChartFX.WPF, ChartFX.WPF.Data, and ChartFX.WPF.Design. However, Developers without the full Beta2 installation are neither able to view WPF controls embedding the Chart using the XAML Designer nor run the parts of the application that embed the ChartFX control. Looking forward to a response.
  5. 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(); } }
  6. I appreciate your follow up. I was able to solve the problem by _not_ setting the Chart.Series.Count before adding the series themselves. I simply call Chart.Series.Clear() as you suggested. Data is passed to the chart during the OnDataContextChanged dependency properties event. Thanks, Bishr
  7. I tried calling a Reset() method with the 2 lines of code you suggested; however, manually setting ItemsSource to null forces the whole chart to be blank, although I subsequently add the data through the SeriesAttributeCollection property. Interestingly, ItemsSource is already null so resetting this dependency property to null is refiring some background events that white out other default properties. Thoughts?
  8. I am using the ChartFX 8 WPF Beta. I have two questions about data binding. 1) How do I remove or clear the default data that shows up with the chart? Even if I have not bound data to the chart, there is still data, but upon object inspection using the debugger, I did not see the values in the Chart.Data or Chart.Points properties. 2) Why does the Bar gallery naturally show multiple series, but the Line gallery does not? I am adding multiple SeriesAttribute object to the Chart.Series collection at run time upon notification of OnDataContextChanged. The same code snippet below works for the Bar gallery, but not the Line gallery. What should I do differently? Many thanks. for (int j = 0; j < argCurveFamily.Curves.Count; j++) { SeriesData sd = argCurveFamily.Curves[j];SeriesAttributes sa = new SeriesAttributes(); MyChart.Series.Add(sa); sa.ItemsSource = sd.Points; sa.BindingPath = "Y"; sa.BindingPathX = "X";}
×
×
  • Create New...