Jump to content
Software FX Community

JuanC

Staff
  • Posts

    863
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JuanC

  1. Our axis inherit the app culture but you can set it as follows < cfx:Axis Culture="en-US"> <cfx:Axis.Labels> <cfx:AxisLabelAttributes Format="Currency" /> </cfx:Axis.Labels></cfx:Axis>Regards, JuanC
  2. 1. Future builds will support this. You will have to set Visibility to Collapsed for AxisX.Grids.Major.Visibility, AxisY.Grids.Minor.Visibility and AxisY.Line.Visibility 2. Not yet. 3. Future builds will allow bindings in most of the per-gallery properties including Rose: StartingAngle, Round, SweepDirection, InternalRadius. These improvements will show up in our beta 3 branch soon. Regards, JuanC
  3. Unfortunately the ItemAttributes collection in the LegendBox class cannot be serialized in XAML in the current build. We will research if we can change this for future builds but we would have to do so in such a way that the current public API is not affected. JuanC
  4. The PointCount property should not be used, it is a way to fake random points in an easy way in your XAML. When passing data manually (instead of binding) we recommend you use Data.Points and Data.Series. I apologize for the documentation misleading you, we will correct this soon. We do not have a property that will "truncate" the elements when using ItemsSource, if you can use LinQ in your project there might be a quick way to get the first X elements in your collection. Regards, JuanC
  5. You will need these namespaces in your root node xmlns:cfxConverters="clr-namespace:ChartFX.WPF.Converters;assembly=ChartFX.WPF"xmlns:cfxControls="clr-namespace:ChartFX.WPF.Controls;assembly=ChartFX.WPF"This template in your Window/Page resources < DataTemplate x:Key="CheckableLegend"> <DataTemplate.Resources> <cfxConverters:VisibilityToBooleanConverter x:Key="visibilityToBool"/> </DataTemplate.Resources> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" SharedSizeGroup="FirstRow"/> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <CheckBox Background="{Binding Path=Fill}" IsChecked="{Binding Path=Visibility, Converter={StaticResource visibilityToBool}}" Margin="2,0" VerticalAlignment="Center"/> <cfxControls:MarkerLegendControl Content="{Binding Path=Self}" Grid.Column="1" /> <Border Background="Transparent" Grid.Column="2" VerticalAlignment="Center"> <ContentControl IsHitTestVisible="false" Content="{Binding Path=Content}" ContentTemplate="{Binding Path=ContentTemplate}" Foreground="{Binding Path=Foreground}" FontFamily="{Binding Path=FontFamily}" FontSize="{Binding Path=FontSize}" FontStyle="{Binding Path=FontStyle}" FontWeight="{Binding Path=FontWeight}"/> </Border> </Grid> <DataTemplate.Triggers> <DataTrigger Binding="{Binding Path=Dimmed}"> <DataTrigger.Value> <sys:Boolean>True</sys:Boolean> </DataTrigger.Value> <Setter Property="Opacity" Value="0.25" /> </DataTrigger> </DataTemplate.Triggers></DataTemplate>And this code in your Window/Page Loaded event chart1.LegendBox.ItemAttributes[chart1.Series].Template = (DataTemplate) FindResource("CheckableLegend"); Please note the following: - VisibilityToBooleanConverter will collapse when the boolean is false, future builds will support a property to change this behavior.- By using MarkerLegendControl you are allowing us to represent different galleries with different shapes, you could also "draw" your own shape and bind to properties such as Fill, Stroke, etc.- Wrapping the ContentControl inside a border fixes an issue trapping mouse events for highlight purposes. Regards, JuanC
  6. That's an interesting issue. You can change the template for a legend box item, so we have a sample/prototype that shows checkboxes in the legend box to allow you to show/hide series. Obviously if unchecking a series would cause the legend box item to dissapear it would give you no way to turn it back on. We have also already assigned meaning to Visibility.Hidden/Visibility.Collapsed, Hidden will cause the series to still "contribute" to the pane or axis this series is attached to. (Note that in the current builds only pane functionality has been implemented but future builds will also incorporate axis functionality). Because of this we will be adding a property called ShowHiddenSeries in the LegendBox, when set to false you will get the behavior you want. Regards, JuanC
  7. Unfortunately any classes that derive from Control in WPF (actually the restriction is on DispatcherObject high in the hierarchy) have thread affinity. Because a big subset of our API does not directly affect our visuals we do not add checks to make sure you are calling from the "right" thread, which is why setting titles works even when called from other threads. Export will render the chart so at this point WPF throws an exception because of the thread mismatch. I would recommend you try to create and export the chart in the UI thread while populating it on the worker thread, I understand you wanted to do this on a different thread but I think the "abstraction quickly leaks". I tried for example the following hack private void OnThread (object sender, EventArgs e){ ThreadStart threadStart = new ThreadStart(ThreadWorker); Thread thread = new Thread(threadStart); thread.Name = "Worker"; thread.SetApartmentState(ApartmentState.STA); thread.Start();} private void ThreadWorker (){ Chart chart = new Chart(); chart.Width = 400; chart.Height = 300; chart.Style = ChartFX.WPF.Motifs.Basic.Style; List<int> dataValues = new List<int>(); dataValues.Add(2); dataValues.Add(4); dataValues.Add(6); dataValues.Add(1); dataValues.Add(3); chart.ItemsSource = dataValues; chart.Export( FileFormat.Png, "C:\\Temp\\Test.png");}But quickly found we do a lot of internal caching on templates and other objects and so if you execute the OnThread method twice the internal objects will also be called from the wrong thread, even if you could enforce a single worker thread we had some rendering issues with this approach. We will check if we can enable this scenario but I am not sure if it is possible because of WPF limitations. Regards, JuanC
  8. The problem with StackPanel is that it does not inform its children on the available size in the "stacked" direction, if you create a class that derives from control and override the MeasureOverride/ArrangeOverride functions you will notice that the controls will receive the available width but will receive double.PositiveInfinity as the available height. If you wanted the charts to have a fixed height you could do so (e.g. Height="200") but obviously depending on the number of charts (items in the listbox) would result on unused space or scrollbars. For this scenario I would recommend using a UniformGrid in the ItemsPanelTemplate instead of a StackPanel. You might want to set Columns="1" to force the grid to create as many rows as elements in the listbox. Regards, JuanC
  9. You can actually customize the gridline as you need but there are some issues that will prevent you from doing bindings to it, note that the following XAML will customize all the attributes you need < cfx:CustomGridLine Value="50" Stroke="Black" StrokeThickness="2"> <cfx:CustomGridLine.Title> <cfx:Title Foreground="Red" HorizontalAlignment="Right">Expected Sales</cfx:Title> </cfx:CustomGridLine.Title></cfx:CustomGridLine>We will work on allowing these bindings to work on future builds. Regards, JuanC
  10. JuanC

    licensing issue

    This is possible but you will have to contact us directly for details. Please send a message to wpf at softwarefx dot com. JuanC
  11. ListTransform is not the right one to use in this scenario as it expects each one of the elements in the top-level list to be another list. If what you want is a chart with as many series as years and as many X axis points as countries (or viceversa) you need to use the CrosstabTransform, e.g. CrosstabTransform crosstab = new CrosstabTransform();crosstab.ColumnPath = "Year";crosstab.RowPath = "Country";crosstab.ValuePath = "Value";chart1.DataTransforms.Add(crosstab);Regards, JuanC
  12. SeriesAttributes.Content is indeed the simplest way to change the string shown in both legend box and tooltips. Please note that for galleries that group more than one series (Bubble, Financial, etc.) you will instead use the GroupContent property on the first series of the group. Regards, JuanC
  13. Is it possible you are creating new Y axes in your reset/refresh operation? I tried the following code in a button int n;if (chart1.AxisY.Title.Content == null) n = 0;else n = (int) chart1.AxisY.Title.Content; chart1.AxisY.Title.Content = n + 1; This works fine everytime you press the button so I think it is possible a new Y axis is being created (either in your code or as a result of how you are refreshing the chart). Regards, JuanC
  14. We have fixed a similar issue in our beta 3 branch, I tested a tab control where the tabitem is collapsed and it works fine. You can download these bits here http://support.softwarefx.com/CfxWPF/Update/BetaHotfix/Hotfix.htm If you need to use beta 2 (because of the go-live license) please drop an email to wpf at softwarefx dot com. JuanC
  15. 380x280 sounds like a resonable size where no clipping should occur, is it possible the legendbox or axis labels are taking too much space? Can you post/send a picture. If you want to take this offline please send an email to wpf at softwarefx dot com. JuanC
  16. The choice between the different Motifs (Glass, Basic, Simple) also depends on which one looks more similar to your app, if the Glass motif matches your application's appearance but performance is degraded you might want to try setting the Chart.UseEffects to false which will remove some bitmapeffects that might cause the performance degradation on certain video chipsets. JuanC
  17. Can you post/send us code that show this behavior? Were you using PlotArea.MinSize 0 in this chart? JuanC
  18. Do you get this on every chart or just the first chart in your application? We did change some our defaults to more elaborate styles so this might be affecting your performance. We have not experienced this performance impact so we would appreciate if you can post/send more info about this. You might also want to try using the Basic style in your XAML < cfx:Chart Style="{x:Static cfxMotifs:Basic.Style}">To use this you will have to add the Motifs namespace to your root node as follows xmlns:cfxMotifs="clr-namespace:ChartFX.WPF.Motifs;assembly=ChartFX.WPF" Regards, JuanC
  19. This behavior is controlled by the Chart.PlotArea.MinSize property (double). This property specifies a percentage that we use to make sure axes and other adorments do not consume all available space. If you set this property to 0, no calculation will be done which means in very small sizes the plotarea will get really small or empty. Regards, JuanC
  20. Yes, you must set the Chart.Gallery property to Gantt. JuanC
  21. The following DataTemplate shows a couple of uses of a BrushConverter <cfxConverters:BrushConverter x:Key="MyBrushConverter"/><DataTemplate x:Key="SimpleBar"> <Rectangle x:Name="Bar" Canvas.Left="{Binding Path=Left}" Canvas.Top="{Binding Path=Top}" Width="{Binding Path=Width}" Height="{Binding Path=Height}" Stroke="Black"> <Rectangle.Fill> <!-- <Binding Path="Self" Converter="{StaticResource MyBrushConverter}" ConverterParameter="L,0,0,0,1,2,=,0,@0;-40,1" /> --> <Binding Path="Self" Converter="{StaticResource MyBrushConverter}" ConverterParameter="L,0,0,0,1,2,=,0,#FF0000,1" /> </Rectangle.Fill> </Rectangle> <DataTemplate.Triggers> <DataTrigger Binding="{Binding Path=Dimmed}"> <DataTrigger.Value> <sys:Boolean>True</sys:Boolean> </DataTrigger.Value> <Setter Property="Opacity" Value="0.25" TargetName="Bar" /> </DataTrigger> </DataTemplate.Triggers></DataTemplate>Both converters share the following L -> Linear Brush0,0,0,01 -> Linear Gradient StartPoint and EndPoint2 -> 2 Gradient Stops What follows is as many gradient stops as needed, in the first sample (commented) we create a gradient that goes from the original color to a darker one using the HSV method =,0 -> = Means use the base color and 0 is the gradient offset@0;-40,1 -> @ Means use HSV model, 0 means not affecting the saturation and -40 means substracting 40 from value. 1 is the gradient offset The second one creates a gradient that goes from the original color to red =,0 -> = Means use the base color and 0 is the gradient offset#FF0000, 1-> Means use Red and 1 is the gradient offset Additionally BrushConverter also exposes HLS conversion (using the % character) or changing alphas. Please let me know if you need samples of these. I apologize for the delay of this post, we have been very busy working out the bits for our go-live license. Regards, JuanC
  22. Can you explain more your scenario? - What do you want to see when your window/page is displayed? empty chart? -At what point are you ready to pass data to the chart? Window Constructor? OnLoaded? Timer? Also if you could post a small sample app it would make it easier for us to either duplicate the issues you are experiencing or suggest changes. Regards, JuanC
  23. 1) You can remove our random data or your own data doing this chart1.Series.Clear();chart1.ItemsSource = null;2) Bar can also show multiple series but we do not support X values in bars by default, you can see this by commenting out the BindingPathX setting. We have a new build where you can optionally turn on X support for bars, to do this you have to specify a single width your bars will have. If you want to use this functionality please drop an email to wpf at softwarefx dot com. Regards, JuanC
  24. You can use a converter in your tooltip templates in the same way as you would use a converter in any other WPF scenario 1) Add an xml namespace to the root node (Page/Window/etc.), if the converter is in the same assembly as the executable you can omit the assembly part 2) Add the converter to a resource dictionary in your template 3) Instantiate the converter in the binding. e.g < Page x:Class="Cfx80App.Pages.Animation.BarHeightPage"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation'>http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:cfx="clr-namespace:ChartFX.WPF;assembly=ChartFX.WPF"xmlns:local="clr-namespace:YourNamespaceGoesHere">
  25. JuanC

    Chart Toolbar

    We have no plans to support the toolbar (and other UI such as context menues) in the first WPF release but it will be supported in future releases. Regards, JuanC
×
×
  • Create New...