Jump to content
Software FX Community

JuanC

Staff
  • Posts

    863
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JuanC

  1. We think we have fixed a couple of leaks exposed in your sample app in build 3576 or later. Please note that in the chart1_DataBound function, the code is using the PointAttributes API although it seems to set these attributes on a per-series basis (i.e it sets all points of a particular series to the same attributes). You can achieve better performance and memory use if you use the Series API in this scenario. JuanC
  2. Yes, we plan to provide UI (whether is a toolbar, menu, or something else is still undefined) in future Chart FX for WPF versions. JuanC
  3. If you want to copy the current chart image to the clipboard you would do something like this System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(); chart1.Export(FileFormat.Png, memoryStream); memoryStream.Position = 0; System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(memoryStream); Clipboard.SetDataObject(new DataObject(DataFormats.Bitmap, bmp), true); bmp.Dispose(); If you are looking to copy the data to the clipboard as text we do not support this built-in, you could obviously retrieve the data using our API and copy the text to the clipboard though. JuanC
  4. You have to download our most recent hotfix here, note that this hotfix works for both release and trial versions. You have to run IE as an administrator if UAC is enabled in your machine. JuanC
  5. We support two kinds of surface charts. 1) Similarly to previous versions of Chart FX, we support a surface chart where multiple series are actually plotted at different Z levels. If you have an equally spaced XZ matrix, this would be the right way as it allows us to also paint horizontal and vertical gridlines through the surface To use this mode you just have to set the Gallery property to Gallery.Surface 2) We also support an XYZ mode where you supply arbitrary XYZ values for all the points, in this mode we expect 2 series the first series specifies the X and Y and the second series values are used as Z. Note that in this mode we create a triangulation of your data but we do not support horizontal and vertical gridlines at the moment. To use this mode you have to add a reference to ChartFX.WPF.XYZ, create a SurfaceXYZ object and assign it to AllSeries.GalleryAttributes The sample you pointed to is using the first approach. JuanC
  6. JuanC

    Partial trust

    Can you send us an email containing the publish folder of a sample application that duplicates this issue? JuanC
  7. I tested a small app that starts with 3 series and when a button is pressed we execute this code chart1.Series[0].Visibility = Visibility.Collapsed; Then when the button is pressed again we run this code chart1.View3D.IsEnabled = true; chart1.Gallery = Gallery.Pie; I also tried to start with a 3D chart, in both cases, our most recent build works as expected. You can download our most recent hotfix here (note that if UAC is enabled you have to make sure IE is run as an Administrator) If the problem persists please try to duplicate the issue in a small dummy app. JuanC
  8. Data Transforms are a somewhat hidden but very important feature in Chart FX for WPF, although in essence they are simply a class that receives an enumeration and returns another, they can make a big difference on your charts. In this post we will discuss a simple transform called the OtherTransform, this transform groups small elements into an
  9. Change the custom coloring code as follows // ... with custom coloring PointAttributes p0 = new PointAttributes(); p0.Fill = Brushes.PaleGreen; chart1.Points[0, 0] = p0; chart1.Points[1, 1] = p0; PointAttributes p1 = new PointAttributes(); p1.Fill = Brushes.SteelBlue; chart1.Points[0, 1] = p1; chart1.Points[1, 0] = p1; Small explanation on why per-point attributes highlight as they do can be found on this thread JuanC
  10. If you are using the same brush for all the series with a specific point then you want your code to look like this chart1.Points[0].Fill = Brushes.Aqua; chart1.Points[1].Fill = Brushes.Brown; By using the indexer with only 1 parameter (point) you are telling that us that the attributes are shared by all series. Advanced: When you use per-point attributes highlight will work with all the elements that are using the same "PointAttributes", e.g. if you do this PointAttributes p = new PointAttributes(); p.Fill = Brushes.Red; chart1.Points[0,2] = p: chart1.Points[1,5] = p; And hover over the third point on the first series (0,2) we will also highlight (1,5). But when you use the getter chart1.Points[0,2].Fill = Brushes.Red We are creating a brand new point attribute that will not be shared. JuanC
  11. Can you post a small sample data set along with the chart you would like (you might have to use paintbrush to retouch the chart we generate) JuanC
  12. You can achieve coloring by value (instead of by point order) using the ConditionalAttributes feature. Please check this thread for a discussion on ConditionalAttributes. JuanC
  13. >> Legends of pie charts disapear when data changes This issue has been fixed on build 3558 >> Charts are not updated, when in an unselected tab and show stale data when they reaplear in the selected tab This as well as the exception is trickier, the events we receive when you navigate away from a tab are similar to the ones generated when a window/page with a chart is closed. To avoid memory leaks we tear down our visuals and also disconnect from notification changes in your data. To workaround this issue you will want to change your code as follows public Window1() { InitializeComponent(); MainGrid.DataContext = this; chart1.AdvancedSettings |= ChartFX.WPF.ChartSettings.KeepVisualsOnUnload; chart2.AdvancedSettings |= ChartFX.WPF.ChartSettings.KeepVisualsOnUnload; this.Unloaded += new RoutedEventHandler(OnUnloaded); } private void OnUnloaded (object sender, RoutedEventArgs e) { chart1.AdvancedSettings &= ~ChartFX.WPF.ChartSettings.KeepVisualsOnUnload; chart2.AdvancedSettings &= ~ChartFX.WPF.ChartSettings.KeepVisualsOnUnload; } Note that is very important that when the window is being uploaded your turn off the flags to make sure we can cleanup properly. Failing to do this might create memory leaks. JuanC
  14. This issue has been fixed on build 3558 Regards, JuanC
  15. This code would generate a single pie with 2 slices chart1.Data.Series = 1;chart1.Data.Points = 2;chart1.Data[0, 0] = 7;chart1.Data[0, 1] = 4; This code would generate two pies each with 3 slices chart1.Data.Series = 2;chart1.Data.Points = 3;chart1.Data[0, 0] = 7;chart1.Data[0, 1] = 4;chart1.Data[0, 2] = 2; chart1.Data[1, 0] = 70;chart1.Data[1, 1] = 125;chart1.Data[1, 2] = 30; JuanC
  16. Both these issues (dissapering labels and flickering) have been fixed in build 3554. There is still a performance hit suffered when using templated axis labels, we will continue working on this to try to improve the performance but it should be used with caution. We are still working on the crash when the chart control is reparented. JuanC
  17. In a chart that is colored per series (Bar, Line, Area, etc.) you can control the brushes used for both Fill and Stroke by setting the chart.Series.Fill and chart.Series.Stroke respectively. If you only set Fill we will use a slightly darker variation for the stroke. In a chart that is colored per points (Pie, Doughnut, Pyramid, etc) you can control the same brushes by setting the chart.Points.Fill and chart.Points.Stroke properties. Note that in a pie chart with 2 series we will use the same color in both pies to represent each point so I am not sure why you asked the following "How about between two pie charts that are part of the same chart control" Regards, JuanC
  18. JuanC

    Partial trust

    >> I read somewhere about an option to avoid the reflection/FileIO by manually calling a static method w. a license string. Could this be a workaround for our situation? Yes, you can send an email to sales at softwarefx dot com and we can provide a license string, which will for sure remove this .NET framework limitation. Please note that we may request for your assembly to be strong named. >> I build a (very) simple application that fails the same way for me I actually meant that if in your simple app instead of using a Chart FX control you use your own dummy licensed component, you will receive the same exception. JuanC
  19. JuanC

    Partial trust

    Does the same XBAP app works fine if you use FullTrust in your settings? Although we fixed the ReflectionPermission issue, to get the license from the executable we end up calling System.ComponentModel.LicenseContext.GetLicenseKey which is theoretically how licensed components should work. If you check the source for this implementation (this functions is virtual and it is actually implemented in RuntimeLicenseContext) either using Reflector or the .NET source code, you will see that it seems to require FileIOPermission on any path it takes. This has been like that since .NET 1.0 but when we last tested XBAP we thought they finally fixed the issue, I am guessing there was some caching involved from previous tests and I apologize for the misunderstanding. Another way to test this for sure would be for you to write a dummy licensed component and try to use it in an XBAP low trust app that does not have FileIOPermission, I suspect you will get the same exception. JuanC
  20. JuanC

    Partial trust

    Are you adding the license information to the main assembly? Note that adding the license to the wrapper dll is not supported. JuanC
  21. Normally we prefer that our customers ship the released bits, I would recommend you send an email to sales at softwarefx dot com so that we can discuss your situation offline. About finding out when the problem is solved: Please try posting a repro case or include more details of this issue as we have been unable to reproduce the bug. Regards, JuanC
  22. Sometimes the size available to a chart imposes a restriction where the legend just takes too much space. In this post we will discuss a couple of possibilities on how to approach this problem Style your title to mimic a legend In Chart FX for WPF titles are fully stylable and although typically titles are just strings, you can in fact use any WPF visuals in the title. The problem with this approach is that you would have to code too much information into the title, for example the number of series, colors, etc. which makes this scenario not practical. Also note that things like highlight would not work. Show the legend underneath the title Just removing the legend box border and docking the legend box to the top might be sufficient in many scenarios [color= blue] <[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Chart.Titles[/color][color= blue]> <[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Title[/color][color= blue]>[/color][color= #a31515]Sales in 1998[/color][color= blue]</[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Title[/color][color= blue]> </[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Chart.Titles[/color][color= blue]> <[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Chart.LegendBox[/color][color= blue]> <[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]LegendBox [/color][color= red]cfx[/color][color= blue]:[/color][color= red]Chart.DockBorder[/color][color= blue]="None" [/color][color= red]DockPanel.Dock[/color][color= blue]="Top" /> </[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Chart.LegendBox[/color][color= blue]>[/color] Note that in our default style (Glass) the main title is drawn larger and outside the plotting area space, if you would rather have them both together you can change the target panel of the legend box, note that in older builds we did not support a way to specify the index so you might need an updated build if this does not generate the expected results [color= blue]<[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Chart.LegendBox[/color][color= blue]> <[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]LegendBox [/color][color= red]cfx[/color][color= blue]:[/color][color= red]Chart.DockBorder[/color][color= blue]="None" [/color][color= red]DockPanel.Dock[/color][color= blue]="Top" [/color][color= red]cfx[/color][color= blue]:[/color][color= red]Chart.TargetPanel[/color][color= blue]="Titles-0" /> </[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Chart.LegendBox[/color][color= blue]>[/color] Combine the title and legend in one line If the number of series is small we might be able to combine the title text and legend box in one line. To do this we will have to style the legend box and items so it will be a little more involved, hopefully the result will be worthwhile. [color= blue]<[/color][color= #a31515]Style [/color][color= red]x[/color][color= blue]:[/color][color= red]Key[/color][color= blue]="LegendTitleStyle" [/color][color= red]TargetType[/color][color= blue]="{[/color][color= #a31515]x[/color][color= blue]:[/color][color= #a31515]Type [/color][color= red]ItemsControl[/color][color= blue]}"> <[/color][color= #a31515]Setter [/color][color= red]Property[/color][color= blue]="Template"> <[/color][color= #a31515]Setter.Value[/color][color= blue]> <[/color][color= #a31515]ControlTemplate[/color][color= blue]> <[/color][color= #a31515]StackPanel [/color][color= red]Orientation[/color][color= blue]="Horizontal"> <[/color][color= #a31515]StackPanel [/color][color= red]Orientation[/color][color= blue]="Horizontal" [/color][color= red]IsItemsHost[/color][color= blue]="True" [/color][color= red]VerticalAlignment[/color][color= blue]="Top" /> <[/color][color= #a31515]TextBlock [/color][color= red]VerticalAlignment[/color][color= blue]="Top" [/color][color= red]Text[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=Tag}"/> </[/color][color= #a31515]StackPanel[/color][color= blue]> </[/color][color= #a31515]ControlTemplate[/color][color= blue]> </[/color][color= #a31515]Setter.Value[/color][color= blue]> </[/color][color= #a31515]Setter[/color][color= blue]></[/color][color= #a31515]Style[/color][color= blue]><[/color][color= #a31515]DataTemplate [/color][color= red]x[/color][color= blue]:[/color][color= red]Key[/color][color= blue]="LegendTitleItem"> <[/color][color= #a31515]StackPanel [/color][color= red]Orientation[/color][color= blue]="Horizontal"> <[/color][color= #a31515]StackPanel.Resources[/color][color= blue]> <[/color][color= #a31515]cfxConverters[/color][color= blue]:[/color][color= #a31515]BoolToVisibilityConverter [/color][color= red]x[/color][color= blue]:[/color][color= red]Key[/color][color= blue]="BoolToVisibility"/> </[/color][color= #a31515]StackPanel.Resources[/color][color= blue]> <[/color][color= #a31515]StackPanel [/color][color= red]VerticalAlignment[/color][color= blue]="Top" [/color][color= red]x[/color][color= blue]:[/color][color= red]Name[/color][color= blue]="textAndLine"> <[/color][color= #a31515]Border [/color][color= red]Background[/color][color= blue]="Transparent"> <[/color][color= #a31515]ContentControl [/color][color= red]IsHitTestVisible[/color][color= blue]="false" [/color][color= red]Content[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=Content}" [/color][color= red]ContentTemplate[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=ContentTemplate}" [/color][color= red]Foreground[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=Foreground}" [/color][color= red]FontFamily[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=FontFamily}" [/color][color= red]FontSize[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=FontSize}" [/color][color= red]FontStyle[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=FontStyle}" [/color][color= red]FontWeight[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=FontWeight}"/> </[/color][color= #a31515]Border[/color][color= blue]> <[/color][color= #a31515]Rectangle [/color][color= red]Fill[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=Stroke}" [/color][color= red]Height[/color][color= blue]="3"/> </[/color][color= #a31515]StackPanel[/color][color= blue]> <[/color][color= #a31515]TextBlock [/color][color= red]Text[/color][color= blue]=" "/> <[/color][color= #a31515]TextBlock [/color][color= red]Text[/color][color= blue]="Vs " [/color][color= red]IsHitTestVisible[/color][color= blue]="false" [/color][color= red]Visibility[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=LastInGroup, [/color][color= red]Converter[/color][color= blue]={[/color][color= #a31515]StaticResource [/color][color= red]BoolToVisibility[/color][color= blue]}, [/color][color= red]ConverterParameter[/color][color= blue]=false}"/> </[/color][color= #a31515]StackPanel[/color][color= blue]> <[/color][color= #a31515]DataTemplate.Triggers[/color][color= blue]> <[/color][color= #a31515]DataTrigger [/color][color= red]Binding[/color][color= blue]="{[/color][color= #a31515]Binding [/color][color= red]Path[/color][color= blue]=Dimmed}"> <[/color][color= #a31515]DataTrigger.Value[/color][color= blue]> <[/color][color= #a31515]sys[/color][color= blue]:[/color][color= #a31515]Boolean[/color][color= blue]>[/color][color= #a31515]True[/color][color= blue]</[/color][color= #a31515]sys[/color][color= blue]:[/color][color= #a31515]Boolean[/color][color= blue]> </[/color][color= #a31515]DataTrigger.Value[/color][color= blue]> <[/color][color= #a31515]Setter [/color][color= red]Property[/color][color= blue]="Opacity" [/color][color= red]Value[/color][color= blue]="0.25" [/color][color= red]TargetName[/color][color= blue]="textAndLine" /> </[/color][color= #a31515]DataTrigger[/color][color= blue]> </[/color][color= #a31515]DataTemplate.Triggers[/color][color= blue]></[/color][color= #a31515]DataTemplate[/color][color= blue]>[/color] [color= blue]<[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Chart.LegendBox[/color][color= blue]> <[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]LegendBox [/color][color= red]cfx[/color][color= blue]:[/color][color= red]Chart.DockBorder[/color][color= blue]="None" [/color][color= red]DockPanel.Dock[/color][color= blue]="Top" [color= red]Tag[/color][color= blue]="Sales in 1998" [/color][/color][color= red]ContainerStyle[/color][color= blue]="{[/color][color= #a31515]StaticResource [/color][color= red]LegendTitleStyle[/color][color= blue]}"[/color][color= blue]> <[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]LegendBox.ItemAttributes[/color][color= blue]> <[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]LegendItemAttributes [/color][color= red]cfx[/color][color= blue]:[/color][color= red]LegendItemAttributes.LegendItemType[/color][color= blue]="Series" [/color][color= red]Template[/color][color= blue]="{[/color][color= #a31515]StaticResource [/color][color= red]LegendTitleItem[/color][color= blue]}"/> </[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]LegendBox.ItemAttributes[/color][color= blue]> </[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]LegendBox[/color][color= blue]> </[/color][color= #a31515]cfx[/color][color= blue]:[/color][color= #a31515]Chart.LegendBox[/color][color= blue]>[/color] Key points from the XAML In LegendTitleStyle we set a template that has a horizontal stack panel (legend items) + the legend Tag, this allows to reuse this style as all we have to change is the LegendBox tag property. In LegendTitleItem we are showing the legend content with a line under it that uses the series stroke instead of fill, this makes the line a little darker. To hide the separator text (Vs) we used a ChartFX converter because it allows us to set Visibility to Collapsed when the bool property (LastInGroup) is true by setting ConverterParameter to false. The built-in BooleanToVisibilityConverter only seems to convert True to Visible. By using a ContentControl instead of a TextBlock our template should work even if you use Series.ContentTemplate to a more complex visual. Please note that the legend box can show much more than just the series as it can display information about conditional attributes, axis sections, axis custom gridlines, etc. but in simple scenarios this approach generates a simpler chart while still providing contextual information to your users. JuanC
  23. If you have a local copy of the 3309 build you should be able to use it instead of the most recent builds. The expiration is in the license and not the dll so if you already installed the trial you should be good to go (until the trial expires 30 days after installation). If you do not have a backup copy of this build please send an email to sales at softwarefx dot com, normally we do not keep all binaries for all versions released while in beta but we can always recompile it. JuanC
  24. Yes, you will get the trial bits if you follow the link. Please note that because this page holds a control that will update your files, you need to run IE as an Administrator if UAC is enabled in your machine. JuanC
×
×
  • Create New...