Jump to content
Software FX Community

JuanC

Staff
  • Posts

    863
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JuanC

  1. There is no max size for the pane collection, you are hitting a bug because there is probably not a lot of vertical space to display 20 series. We will fix this bug but obviously if you keep adding series, there will be a point where you run out of space. We have other ways to layout the panes so that you can have multiple columns or vertical scrollbars. Regards, JuanC
  2. Obviously you know more about your data but it seems to me that you are clearly plotting 2 series as implied by these statements "but I only want 2 entries in the legend box" "Also a stretch, but is there anyone to link the plots together so that when one is highlighted in the legend box it would show all the Hot or Cold data" Because of this I think using 2 series will be beneficial for your particular chart, I modified your plotResponsePlots function as follows public void plotResponsePlots (Chart chart, double[][] value, int step, int start){ chart.ItemsSource = null; List<XYMeasure> dataHot = new List<XYMeasure>(); List<XYMeasure> dataCold = new List<XYMeasure>(); double location; for (int k = 0; k < value.Length; k++) { List<XYMeasure> dataPts = ((k % 2) == 0) ? dataHot : dataCold; if (dataPts.Count != 0) { // Start line from previous value location = ((double) dataPts[dataPts.Count - 1].X) + step; // Add an empty XYMeasure, this will provide the line break dataPts.Add(new XYMeasure()); } else location = start; for (int i = 0; i < value[k].Length; i++) { dataPts.Add( new XYMeasure(location, value[k])); location += step; } } ChartFX.WPF. SeriesAttributes seriesHot = new SeriesAttributes(); seriesHot.Fill = System.Windows.Media. Brushes.Red; seriesHot.Content = "Hot"; seriesHot.Marker.Shape = ChartFX.WPF. MarkerShape.Circle; assignSeriesData(dataHot, seriesHot); ChartFX.WPF. SeriesAttributes seriesCold = new SeriesAttributes(); seriesCold.Fill = System.Windows.Media. Brushes.Blue; seriesCold.Content = "Cold"; seriesCold.Marker.Shape = ChartFX.WPF. MarkerShape.Circle; assignSeriesData(dataCold, seriesCold); chart.Series.Add(seriesHot); chart.Series.Add(seriesCold); } public void assignSeriesData (List<XYMeasure> dataPts, ChartFX.WPF.SeriesAttributes series){ series.BindingPath = "Y"; series.BindingPathX = "X"; series.ItemsSource = dataPts; } I tested it with code like this double[][] data = new double[4][];data[0] = new double[] { 10, 12, 14 };data[1] = new double[] { 8, 10, 12 };data[2] = new double[] { 10, 12, 14, 12, 10, };data[3] = new double[] { 8, 10, 12, 11, 9 };plotResponsePlots(chart1, data, 1, 1); Note that you might need a new hotfix (send email to wpf at softwarefx dot com) as we recently fixed an issue related to reading data from nullable values. We will investigate other ways to hide series from the legendbox but I truly think creating 2 series will work best for you. Hope this helps JuanC
  3. We retried both setting the AxisX properties in XAML ... < cfx:Chart x:Name="chart1" Gallery="Line" ItemsSource="{Binding Source={StaticResource bidsData}}"> <cfx:Chart.Series> <cfx:SeriesAttributesCollection> <cfx:SeriesAttributes BindingPath="Value" BindingPathX="Date" /> </cfx:SeriesAttributesCollection> </cfx:Chart.Series> <cfx:Chart.AxisX> <cfx:Axis> <cfx:Axis.Labels> <cfx:AxisLabelAttributes Format="Date" CustomFormat="MMM-yy"/> </cfx:Axis.Labels> </cfx:Axis> </cfx:Chart.AxisX></cfx:Chart>As well as setting the AxisX properties in code chart1.AxisX.Labels.Format = AxisFormat.Date; chart1.AxisX.Labels.CustomFormat = "MMM-yy";Both tests worked as expected, can you check if you can duplicate this issues with our latest build? Can you create a small sample app with hardcoded data that reproduces the problem? Regards, JuanC
  4. JuanC

    Dragging the Plot

    We have fixed these issues in our current build. PositionRelativeToPlotArea will return negative values or values that exceed the boundaries. Note that IsInsidePlotArea will still return false when appropriate. Also we are now honoring the Cursor property from PlotAreaAttributes (note that in your build it will not appear in the Intellisense window as we did not handle it) Please send an email to wpf at softwarefx dot com to request a hotfix. Regards, JuanC
  5. >> I have a multi series graph that actually uses multiple series to show the same graph because of discontinuities in the line. Can you explain how your data looks like (i.e. classes in your data layer or columns in your database)? We support discontinuities in the line through a predefined value (Chart.Hidden) so you should be able to get the chart want only using 2 series, this will make sure that you do not have to "hack" the legend box or highlight. Regards, JuanC
  6. The Fill property is of type brush (like all other WPF elements) so you have to create a SolidColorBrush or use the Brushes class to use a stock brush. chart1.Series[0].Fill = System.Windows.Media. Brushes.Red;chart1.Series[1].Fill = new System.Windows.Media.SolidColorBrush(Color.FromArgb(128, 240, 40, 0)); Regards, JuanC
  7. JuanC

    dotted line

    You change the StrokeDashArray for a particular series or for AllSeries. This property is a DoubleCollection where you supply the length for the segments and the spaces, e.g. chart1.Series[0].StrokeDashArray = new DoubleCollection(new double[] { 10, 2, 2, 2 });Regards, JuanC
  8. My suggestion was that you would write a script like the following MyDrillDetailsData.ps $systemname=$args[0] get-wmiobject Win32_PerfFormattedData1 -computerName MANAGER| where {$_.Name -like "$systemname*"} | select Name,ReadKBPers,ReadLatencyus,ReadReqPers,WriteKBPers,WriteLatencyus,WriteReqPers Note that you can use a where construct and use $systemname in any way supported by PS. This would simplify your Details.ps1 as follows $systemname=$args[0] MyDrillScript $systemname | out-chart ... Regards, JuanC
  9. You might be able to workaround this issue if you can separate the script that gets the drilldown data from the one where out-chart is executed, please note the following sample ps | out-chart -values Handles -label ProcessName -drilldown_script ShowProcess.ps1 -drilldown_parameter {$_.ProcessName} Version of ShowProcess.ps1 that does NOT work $selected = $args[0] ps | where {$_.ProcessName -eq $selected} | out-chart -values Handles,CPU -Label ProcessName -refresh 0:0:5 Version of ShowProcess.ps1 that works $selected = $args[0] ps $selected | out-chart -values Handles,CPU -Label ProcessName -refresh 0:0:5 We will research if we can make both scenarios work but in the meantime separating your scripts might be the way to go. Regards, JuanC
  10. We can help you better if you include some or all of the following - A screenshot of the chart you are looking for - A sketch of how your data layer looks like - Code/XAML showing the things you have tried Regards, JuanC
  11. Build 3015 of ChartFX.WPF.Data did not include the ListTransform class. This class was included in build 3042 and we recently fixed some edge cases. Please send a message to wpf at softwarefx dot com to request a hotfix. Regards, JuanC
  12. We do not have a feature that will automatically put text into the middle of an area chart but we support an Annotation API that allows you to add any visuals on top of the chart including text and "attach" it to an XY logical position, i.e. you do not have to worry about pixel positioning but you do have to provide X and Y positions in terms of your axes. Note that an annotation is not currently tied to a specific series. In the following sample we are creating 3 rectangles (you can use TextBlocks instead), note the use of the attached properties to control where these items are displayed Also note that you need to add a reference to ChartFX.WPF.Annotations xmlns:cfxAnnotation="clr-namespace:ChartFX.WPF.Annotation;assembly=ChartFX.WPF.Annotation" < cfx:Chart Gallery="Line" x:Name="chart1"> <cfx:Chart.Extensions> <cfxAnnotation:Annotations x:Name="annotations"> <Rectangle Width="80" Height="20" Fill="#80FF0000" cfxAnnotation:Annotations.AttachX="2" cfxAnnotation:Annotations.AttachY="40" HorizontalAlignment="Center"/> <Rectangle Width="20" Height="20" Fill="LightBlue" Stroke="Black" Canvas.Right="10" Canvas.Top="10"/> <Rectangle Fill="#8000FF00" cfxAnnotation:Annotations.AttachX="2" cfxAnnotation:Annotations.AttachY="65" HorizontalAlignment="Center" cfxAnnotation:Annotations.AttachWidth="1" Height="20" cfxAnnotation:Annotations.PaintBefore="true"/> </cfxAnnotation:Annotations> </cfx:Chart.Extensions></cfx:Chart>Regards, JuanC
  13. Please include in your post - How your data layer looks like - Code/XAML that you have tried and screenshot of chart you are getting Regards, JuanC
  14. We support both a collection of ObservableCollections as well as a collection of CLR objects that in turn contain a Collection property. In these scenarions the number of series will be dictated by the number of objects in the outer collection. Please note that we will not observe changes in the outer collection in the current builds. To use this you need to add a reference to ChartFX.WPF.Data and your XAML would look like this Scenario 1) Collection of CLR objects that expose a collection property class OuterObject { List<InnerObject> Sales {get;} } class InnerObject { double Price {get;} } <cfx:Chart.DataTransforms> <cfxData:ListTransform ColumnPath="Sales" ValuePath="Price" /> </cfx:Chart.DataTransforms> Please note that in this scenario each series will have a different number of points, you can additionally use the XValuePath to point to a numerical or datetime property. If the OuterObject exposes a string property that identifies each series you can use the SeriesPath to point to this property. Scenario 2) Collection of Collections In this case there is only one class (InnerObject) and you are providing a collection where each item is in turn a collection of InnerObjects. <cfx:Chart.DataTransforms> <cfxData:ListTransform ValuePath="Price" /> </cfx:Chart.DataTransforms> Scenario 3) Inner CLR objects contains a string field that should be used to "match" objects in different collections class InnerObject { double Price {get;} string Product {get;} } In this case we will match InnerObjects in different collections by Product Names, i.e. you will get a chart with as many series as items in the outer collection and as many points as the combined products found in all collections. Important: we assume in this case that the inner collections are ordered by Product. <cfx:Chart.DataTransforms> <cfxData:ListTransform RowPath="Product" ColumnPath="Sales" ValuePath="Price" /> </cfx:Chart.DataTransforms> Hope this helps. JuanC
  15. What do you mean you are "unable to use this feature", does it crash? does it generate the wrong chart? Did you also try setting the min? You might also want to expand (maybe including pictures) on what you mean by "set the bounds for the graph based on the container". Regards, JuanC
  16. The reason is that the tstObj structure does not have any public properties. You can reach them from Window1 because it is a nested class but we restrict our search to public properties. Regards, JuanC
  17. Can you please describe in detail the data you want to pass the chart? Is it an array of doubles? An array of CLR objects? Which properties are you interested in plotting? Are you using LinQ? Any information you can provide will help us point you in the right track. Regards, JuanC
  18. Zooming and Scrolling is currently not supported on Silverlight. This is something we have discussed supporting in future builds so feel free to "vote" on how important this is for your particular scenario. Regards, JuanC
  19. Property names for both our 3D objects and the logical items they are bound to were changed as follows Left="{Binding Path=Left}" Top="{Binding Path=Top}" Width="{Binding Path=Width}" Height="{Binding Path=Height}" Depth="{Binding Path=Depth}" Front="{Binding Path=Front}" Regards, JuanC
  20. Because of the way WPF works we have to use some API that requires our visuals to be created (even if they are not visible or parented at the time). We also had to fix some timing issues related to the fact that WPF uses a separate rendering thread. We have a new build that should work in your scenario, please send a message to wpf at softwarefx dot com with a hotfix request. We have tested the following Chart chart = new Chart();chart.Measure(new Size(600, 300));chart.Arrange(new Rect(0, 0, 600, 300));chart.Export(FileFormat.Png, "C:\\Temp\\Test.png");Note that if you do not do measure/arrange we will generate a chart with a default 400x300 size. Also note that we have not yet tested scenarios where you use a single chart to generate multiple images while changing data and/or visual attributes. Regards, JuanC
  21. >> though at present the actual data on the chart is not important If the actual data is not important then I would recommend instead of assigning ItemsSource you use Chart.Data.Series and Chart.Data.Points to force a particular shape of random data. Regards, JuanC
  22. We did change some of the code we use to detect the properties to be plotted. Have you tried passing a collection of numbers or a collection of CLR objects? Regards, JuanC
  23. We were able to duplicate and fix the NullReferenceException but note that in the sample you are providing an array of strings so there is nothing to be plotted. Regards, JuanC
  24. You should receive a new build in a day or two. Regards, JuanC
  25. Please send a message to wpf at softwarefx dot com, we should also be updating our download area soon. Regards, JuanC
×
×
  • Create New...