Jump to content
Software FX Community

JuanC

Staff
  • Posts

    863
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JuanC

  1. A border template is supposed to honor the background so in a sense it can affect it. The template can also show some effects on top of the background. Please note that if you plan to use our built in borders you should use the Chart.Border property along with an element from the ChartFX.WPF.Borders class. The reason for this change is design time support in Visual Studio. You can easily see how our different borders look if you change the Chart.Style to ChartFX.WPF.Motifs.Basic and then use the different borders, by setting the style to basic you will have a simpler chart which will help see the different borders. JuanC
  2. This bug has been fixed on RC1 which you can download here Regards, JuanC
  3. Currently we do not support combining categorical and non-categorical X axes in the same chart. We are about to release a new beta build (Beta 3) so it was not possible to include a fix on it but we have a different branch where a fix has been implemented. Please contact our support department (wpf at softwarefx dot com) and include a link to this thread. Regards, JuanC
  4. We think we have found a couple of issues related to memory consumption, one of them is related to business objects that support INotifyPropertyChanged while the other is a more general issue when a chart is refreshed several times. Please contact our support department to request a hotfix. Regards, JuanC
  5. Can you post the version of ChartFX.WPF.dll that you are using? We just tested the same code against our more recent build and the memory consumption seems stable, you might want to contact us (wpf at softwarefx dot com) to request an updated installer. JuanC
  6. You have to modify the first loop as follows for (int i = 0; i < 3; i++) { Pane pane = new Pane(); Axis axisX = new Axis(); axisX.DataFormat.Format = AxisFormat.Date; axisX.Labels.Format = AxisFormat.Date; pane.AxesX.Add(axisX); Axis axisY = new Axis(); axisY.Min = min; axisY.Max = max; axisY.AxisStyle = AxisStyles.ShowEnds | AxisStyles.AutoFirstLabel; axisY.Labels.Decimals = 2; pane.AxesY.Add(axisY); SeriesAttributes sa = new SeriesAttributes(); sa.Gallery = Gallery.Line; sa.ItemsSource = RandomData(30); sa.BindingPath = "Value"; sa.BindingPathX = "Date"; // This is important as the series will not inherit the axes from the pane sa.AxisX = axisX; sa.AxisY = axisY; pane.Series.Add(sa); // This is important as some code will loop through the chart series chart1.Series.Add(sa); chart1.Panes.Add(pane);} Regards, JuanC
  7. The code looks fine, are you able to duplicate this exception by filling the items collection with dummy data that "looks like" your real data? If so, please post the items contents needed to duplicate the problem. Can you also post the file version for ChartFX.WPF.dll? JuanC
  8. I am not sure if this is a bug in our code or something wrong in DrawingContextExtensions, you can workaround this issue by setting the PlotArea.ClipToBounds to false to avoid clipping. Most of the time setting ClipToBounds to false will have no effect unless you are manually setting the Y min/max. chart.PlotArea.ClipToBounds = false;JuanC
  9. By default our bar chart does not support X values, the main reason for this is that in a line/area chart you can easily connect the points regardless of their spacing in X but a bar chart is typically drawn with all bars having the same width where your data points could be Jan 1, Jan 2, Jan 3, Feb 15. Is your data "equally spaced" in X? Regards, JuanC
  10. The CustomFormat gets ignored when handling TimeSpans, primarily because the .NET framework does not support formatting timespans as it does with numbers, or DateTime. We will add custom code to format timespans in our beta 3 bits. It will support d,h,m,s,f (days, hours, minutes, seconds, and milliseconds) as well as repeating each character more than once to support leading zeroes. Regards, JuanC
  11. JuanC

    WPF combo chart

    Sorry for our delay getting back to you, we have added some functionality and bug fixes to our beta3 bits and you can get very close to the chart you want to create. Attached you will find a sample XAML/CS code we used to try to duplicate it. You can download our most recent bits here, or contact wpf at softwarefx dot com to request an updated build. Regards, JuanC
  12. Note that the following approach (where you can use your own converter) will only change the displayed value on the legend box, if you hover on a pie slice you will still get a tooltip showing the numerical value of the RunStatusCode. In XAML < DataTemplate x:Key="legendTemplate"> <Grid x:Name="grid" Margin="{Binding Path=Margin}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" SharedSizeGroup="FirstRow" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <cfxControls:MarkerLegendControl Content="{Binding Path=Self}" Grid.Column="0" /> <Border Background="Transparent" Grid.Column="1" VerticalAlignment="Center"> <TextBlock IsHitTestVisible="false" Text="{Binding Path=Content, ConverterGoesHere}" 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" TargetName="grid" /> </DataTrigger> </DataTemplate.Triggers></DataTemplate>You might need the following namespaces in your root node xmlns:cfxControls="clr-namespace:ChartFX.WPF.Controls;assembly=ChartFX.WPF"xmlns:sys="clr-namespace:System;assembly=mscorlib"In your code you will need the following chart1.LegendBox.ItemAttributes[chart1.AxisX].Template = (DataTemplate) FindResource("legendTemplate"); Regards,JuanC
  13. We will research this issue to try find a fix or workwaround. Both suggestions (AxisFormat.String or changing the AxisFormat.None default behavior sound feasible) Most properties in ChartFX are Dependency Properties (to support Binding, Animation, etc.) this means that internally we know whether the property is set or not. About cloning, we are working on export/import scenarios so hopefully you will be able to use that functionality in the future, for now you might want to explore using GetLocalValueEnumerator to loop through the "locally set" DPs ignoring readonly properties, you could then assign only the properties that have been truly set. Unfortunately there is a small percentage of properties that are not DPs, for those you might still have to assign the old fashion way. Regards, JuanC
  14. Even though you are overriding GetVisualChild and VisualChildrenCount you have to explicitly call AddVisualChild, e.g. public ChartWrapper () { AddVisualChild(_chart); } Please note that if you write a wrapper in this way there a couple of things you have to be aware of 1) Although you can create CLR properties and forward those calls to our properties, if you want to support binding or animations you will have to make them dependency properties and make sure that a change in your DPs cause changes in ours and viceversa 2) Our object model is deep, e.g. a chart exposes an AxisX and AxisY properties of type Axis, it also exposes a collection of SeriesAttributes to control how each series looks, you will probably have to write wrappers for these objects as well. I would suggest you also look into deriving from our class instead of wrapping around it, this would allow you to hide properties but the remaining properties would still be DPs. The problem of the subproperties would still be there though. Regards, JuanC
  15. JuanC

    WPF combo chart

    Yes, this is a chart we think you can achieve using our product. There might be a few things (e.g. the arrow to the left of the X axis to scroll the chart) that might get a little tricky. Can you post a little more details about your data, e.g. - What is your typical total data range? 1 day? Weeks? - How are the action points, data and the dynamic info related to each other in your data layer - How important is the fact that some labels in the X axis are bold? How do you determine which ones are bold? - You mentioned a bar chart, is it a typo or do you also have some specific questions for a bar chart? If you can provide more information we can help you tweak the chart properties and templates. Regards, JuanC
  16. Our control is designed to work with .NET 3.0, .NET 3.5 and .NET 3.5 SP1 but we do not have any dependencies other than .NET 3.0 JuanC
  17. Can you check the version of ChartFX.WPF.dll you are using? We think this particular exception has been fixed so can also download our most recent bits here If the problem persists please try posting a code snippet including chart settings to help us duplicate the issue. Regards, JuanC
  18. You can control the visibility of items in the legend box using the LegendBox.ItemAttributes property, this property is not XAML friendly so you will have to set it in code. Assuming you are drawing the expected production line using custom gridlines, you can control its visibility in the legend box with the following code: chart1.LegendBox.ItemAttributes[chart1.AxisY.CustomGridLines].Visibility = Visibility.Collapsed; Note that ItemAttributes has another indexer with an integer that specifies the index of the item you want to modify, so if you had a chart with 3 series you could hide the second series from the legend box with the following code chart1.LegendBox.ItemAttributes[chart1.Series, 1].Visibility = Visibility.Collapsed;We do not have an answer for your question on how to control the legend box items order, informally we have discussed the following options 1) By default as you noted we invert the order in the legend box for stacked charts, the rationale behind this change was to show the items in the legend box in a similar way as how they are shown in the plot area. We could add a boolean property to disable this behavior. 2) Adding a integer property in LegendBox.ItemAttributes that allows you to override the order, we would have to decide whether this order apply to items in each of the groups supported by the legend box (series, points, axis gridlines and sections, conditional attributes, etc.) or if it is a global order (allowing you to intermix elements from the different groups). Regards, JuanC
  19. We think we have fixed the internal caching issues that were causing thread affinity (some DataTemplates had to be sealed and some freezables were not properly frozen) so you should be able to create and export charts from worker threads. Please note that the threads have to be STA so you cannot use ThreadPool. We also found that BitmapEffects do not work in this environment so you will have to use the ChartFX.XBAP assemblies instead of ChartFX.WPF.*, our XBAP assemblies do not include bitmap effects because they do not work well in low trust scenarios. These changes have been included in our beta 3 bits which you can download here. Regards, JuanC
  20. Although as you noted we do not expose a FillPath property you can achieve the chart you are looking for by changing the template we use to draw the chart markers (in this sample I am assuming it is a bar chart). <cfx:Chart Gallery="Bar" x:Name="chart1" ItemsSource="{Binding Source={StaticResource bidsData}}"> < cfx:Chart.Series> < cfx:SeriesAttributes BindingPath="AverageCost"/> </ cfx:Chart.Series> < cfx:Chart.AllSeries> < cfx:AllSeriesAttributes> < cfx:AllSeriesAttributes.Template> < DataTemplate> < Rectangle Width="{Binding Path=Width}" Height="{Binding Path=Height}" Fill="{Binding Path=DataItem.AverageBrush}" /> </ DataTemplate> </ cfx:AllSeriesAttributes.Template> </ cfx:AllSeriesAttributes> </ cfx:Chart.AllSeries> < cfx:Chart.AxisX> < cfx:Axis> < cfx:Axis.Labels> < cfx:AxisLabelAttributes BindingPath="id> </ cfx:Axis.Labels> </ cfx:Axis> </ cfx:Chart.AxisX> </cfx:Chart> Note that I am assuming a property called AverageBrush that returns a WPF brush, if you have a color property you can either create an extra property that returns a new SolidColorBrush using the color or you can also use a Converter in your binding. Regards, JuanC
  21. You also want to set the format of the X axis labels to be date or datetime, e.g. chart1.AxisX.Labels.Format = AxisFormat.Date;JuanC
  22. We have made some changes in our beta3 branch to support this scenario. xmlns:cfxData="clr-namespace:ChartFX.WPF.Data;assembly=ChartFX.WPF.Data"<XmlDataProvider x:Key="myXmlData"> <x:XData> <Elems xmlns=""> <Elem Result="Success" /> <Elem Result="Failed" /> <Elem Result="Running" /> <Elem Result="Success" /> </Elems> </x:XData></XmlDataProvider> < cfx:Chart Gallery="Pie" x:Name="chart1" Grid.Row="2" Margin="10" DataBound="OnDataBound"> <cfx:Chart.ItemsSource> <Binding Source="{StaticResource myXmlData}" XPath="Elems/Elem" /> </cfx:Chart.ItemsSource> <cfx:Chart.DataTransforms> <cfxData:CrosstabTransform RowPath="@Result" Sorted="false"/> </cfx:Chart.DataTransforms></cfx:Chart>You can upgrade your bits to beta3 here Because you will be binding to a collection of CLR objects your RowPath should be the name of the property (enum or string) that represents the result without the @ sign. Please note that we also fixed some issues related to the ObservableCollection change events when using DataTransforms. Regards, JuanC
  23. There are 2 factors that affect the background of the chart 1) Background property: This is a brush property so you can use solid colors as well as any other WPF brush. XAML:<cfx:Chart x:Name="chart1" Background="LightYellow"> Code:chart1.Background = System.Windows.Media.Brushes.Blue; 2) Style property: some styles might use the background in different ways or draw semi-transparent layers on top of the background, this property allows you to change the overall look of the chart. Note that each style will use a different color Palette (Palette Property) but you can override the colors by changing the palette or changing specific brushes. XAML:xmlns:cfxMotifs="clr-namespace:ChartFX.WPF.Motifs;assembly=ChartFX.WPF" < cfx:Chart x:Name="chart1" Style="{x:Static cfxMotifs:Simple.Style}">Code:chart1.Style = ChartFX.WPF.Motifs.Simple.Style; Regards, JuanC
  24. We have a somewhat obscure property called MergeResources (note that is not browsable so it will not appear in IntelliSense) that we use to allow different styles - Glass, Basic, Simple - to have different common resources such as ScrollBar styles. We did not use the Resources.MergeDictionaries WPF feature because of leaks when using this approach. The following code will remove the scrollbar style included in our motif so that you can add your own, if you test this code against a Glass chart you will get a windows-themed scrollbar. You could then create your own ScrollBar style and add it to the resourceDictionary variable. Note that you have to set the MergeResources to point to a new resource dictionary as we do not track changes to the existing one. ResourceDictionary resourceDictionary = new ResourceDictionary(); foreach (object key in chart1.MergeResources.Keys) { if (key != typeof(System.Windows.Controls.Primitives.ScrollBar)) resourceDictionary.Add(key, chart1.MergeResources[key]);} // resourceDictionary.Add(typeof(System.Windows.Controls.Primitives.ScrollBar), FindResource("MyScrollBar");chart1.MergeResources = resourceDictionary;Regards, JuanC
  25. Most of these features are now available in the beta 3 bits which you can download here Regards, JuanC
×
×
  • Create New...