Jump to content
Software FX Community

JuanC

Staff
  • Posts

    863
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JuanC

  1. I tested your script using our most recent build and it worked fine (I got some warnings because I do not have your template but got no exceptions). I understand we should be pushing a new service pack in a day or 2. If you do not see build 3588 or later available please let me know and we can send you a zip file while we work out the site. JuanC
  2. Previously the ability to control the space (or overlapping) for different series within a point was restricted to the gallery style. Starting on hotfix build 3712 we have added a property to the Bar class called IntraSeriesGap, by setting this to a positive value you will be able add empty space between series. Note that this number is in pixels (actually device independent pixels). A negative value will result in series overlap. JuanC
  3. - We have fixed the issue related to ToolTipConnectedStyle.Closest, if you select this approach you will get 1, 3 and 4 but not 2 as you pointed out. - We have also added code to consider Marker.Opacity = 0 in the same way as Marker.Visibility = Visibility.Collapsed from the legend box point of view, which means that you will get all 4. Note that when you set Marker.Opacity to 0 we are still "rendering" a bunch of invisible markers, also note that by default the size of such markers depend on the spacing between the points. These fixes are supported in build 3712 or later (available now as a hotfix) JuanC
  4. Daniel, If you want to hide the markers (which I suspect you are already doing) you would need the following code chart1.AllSeries.Marker.Visibility = Visibility.Collapsed;Our default behavior is to show "point" tooltip only when hovering over the marker in a line chart, when you hover over the line we show a tooltip that contains both points, if you want to modify this behavior you could write chart1.AllSeries.ToolTips.ConnectedStyle = TooltipConnectedStyle.Closest; Unfortunately there is a bug in the current builds that will prevent this from working, we should fix this issue in the our next hotfix.JuanC
  5. The reason for this is that the control in the page actually downloads the bits from additional FTP sites and these sites are typically refreshed every night. We just pushed a manual update so if you apply the hotfix now you should receive the 3702 build. JuanC
  6. You can download the most recent hotfix here, note that you need to run IE as Administrator if UAC is enabled in your machine as it will try to update your Chart FX files. You have our current "service pack" build (service packs go through more testing including some manual testing not run on hotfix builds). JuanC graphstocks.zip
  7. Please note that we might still need a repro case, you can send it to support or post it here and include some details about where we should zoom to duplicate the issue. JuanC
  8. We do have some special code in Export because WPF needs the visuals to generate an image but if the chart has never been rendered then the visuals do not exist so we do internally force a call Measure/Arrange and optionally have to wait for the visuals to be ready. An alternative would be to render the charts in a different thread, to use WPF you have to make it STA and ChartFX has some code that checks if the thread is a background thread, e.g. private void Button_Click (object sender, RoutedEventArgs e) { ThreadStart threadStart = new ThreadStart(this.DoWork); Thread thread = new Thread(threadStart); thread.SetApartmentState(ApartmentState.STA); thread.IsBackground = true; thread.Start(); } private void DoWork() { // Process 10 charts, and put them in this directory: int filesToGenerate = 10; Note that when using a separate thread, there will be an exception related to some blurs we use if you press the button twice, it seems that WPF caches some of the bitmap effects but they are not thread safe, you can try setting the Style to ChartFX.WPF.Motifs.Basic.Style, this will obviously make your chart look simpler. Note that with your original code I only got the reflection issue so I was unable to duplicate the other issues, you can alternatively turn off this reflection by setting UseEffects to false. Regards, JuanC
  9. I am not sure if you will like the result but this is how you would force every label to appear chart1.AxisX.Step = 1; Note that in this case we will not do auto-layout of the labels so you might also have to play with AxisX.Labels, e.g. chart1.AxisX.Labels.Angle = 90; JuanC
  10. We have found and fixed the exception when removing an axis, any build marked 3701 or later will include the fix. >> When I do Chart.Series.Clear(), why does ChartFX add two default series back to the chart? When I clear the series, I'd really like it to actually be clear. This is because we want a default chart (no series) to show some random data as opposed to showing "No Data Available", you might want to try setting Chart.ItemsSource to null and see if that gives you an empty chart instead of the 2 random series. If this doesn't work please try posting a simple app that shows this behavior. Regards, JuanC
  11. You can display the number of items by using the DataItem.Items.Count path, note that we expose the items collection, and we use this in the tooltip to display the detail of all the elements grouped in the Other bucket. <TextBlock Text="{Binding Path=DataItem.Items.Count}"/> To show the accumulated value or percentage you can use ToolTipConverter, the advantage of using this is that it knows about Axis settings, e.g. if you set the Axis.Format to currency it will show the currency sign when displaying the value, e.g. xmlns:cfxConverters="clr-namespace:ChartFX.WPF.Converters;assembly=ChartFX.WPF" <DataTemplate.Resources> <cfxConverters:TooltipConverter x:Key="MyTooltipConverter"/></DataTemplate.Resources> <TextBlock> <TextBlock.Text> <Binding Path="Self" Converter="{StaticResource MyTooltipConverter}" ConverterParameter="V: %v P: %p%%" /> </TextBlock.Text></TextBlock> JuanC WpfApplication1Modified.zip
  12. Good news, most of our code was internally ready to handle gridlines on the back or front (note that Axis.Grids.ShowInFront allows to move the default grids to the front) so we have added a ShowInFront property to CustomGridLine (default is true). You can pickup this change by downloading hotfix build 3693 or later here, note that if UAC is enabled in your machine you have to run IE as administrator. I hope this works for you JuanC
  13. You can download the most recent hotfix here Please note that this page will try to update your Chart FX files so if UAC is enabled in your machine you have to run IE as an Administrator. JuanC
  14. In Build 3688 we have added a MaxCount property to OtherTransform. If you set this to 5 it means we will make sure at most 5 elements are plotted (where the fifth one will be "Other") but will do nothing if the original data contains 5 or less elements. This also means that MinPercentage will be ignored in this scenario. JuanC
  15. JuanC

    Retheming chart

    We do support external theming which may encompass changing palettes, chart templates, gallery templates, marker templates, etc. As of today we do not provide source of the themes we ship so certainly there might be some trial and error involved. Also styling galleries (e.g. changing how bars/lines/areas/etc look) also includes knowing about the logical items used when we are rendering each chart type. You can get some details by looking here and here. If you want to achieve a particular look you can send us a sketch by email and we will point you in the right direction. JuanC
  16. We have added a property called LabelTemplate to the OtherTransform class in build 3688 that will allow you to set a custom DataTemplate for the Other element. JuanC
  17. This is a bug fixed on build 3688 or later (this should be available as a hotfix in a couple of days). Note that the Point and Value reported in the EventArgs will be the index/value closer to the mouse position. JuanC
  18. If all labels are similar or you do not care about alignment you could change the Panel used by the legend as follows <cfx:Chart.LegendBox> <cfx:LegendBox Visibility="Visible" DockPanel.Dock="Bottom"> <cfx:LegendBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel/> </ItemsPanelTemplate> </cfx:LegendBox.ItemsPanel> <cfx:LegendBox.ContainerStyle> <Style TargetType="{x:Type ItemsControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ItemsPresenter/> </ControlTemplate> </Setter.Value> </Setter> </Style> </cfx:LegendBox.ContainerStyle> </cfx:LegendBox> </cfx:Chart.LegendBox> Note that we are also changing the ContainerStyle, if you do not this ItemsControl will use a ScrollViewer around the panel that would defeat the WrapPanel purpose. If you do care about alignment and have knowledge about the number of items and size of the chart you could use UniformGrid instead. <cfx:Chart.LegendBox> <cfx:LegendBox Visibility="Visible" DockPanel.Dock="Bottom"> <cfx:LegendBox.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Rows="2"/> </ItemsPanelTemplate> </cfx:LegendBox.ItemsPanel> </cfx:LegendBox> </cfx:Chart.LegendBox> When using UniformGrid we do not need to set ContainerStyle. Obviously both solutions are not optimal so starting in build 3688 (which should be available in a couple of days) you will be able to use a custom Chart FX panel called UniformOrientationGrid which will arrange items in a UniformGrid calculating the number of rows/columns automatically. <cfx:Chart.LegendBox> <cfx:LegendBox Visibility="Visible" DockPanel.Dock="Bottom"> <cfx:LegendBox.ItemsPanel> <ItemsPanelTemplate> <cfxControls:UniformOrientationGrid/> </ItemsPanelTemplate> </cfx:LegendBox.ItemsPanel> <cfx:LegendBox.ContainerStyle> <Style TargetType="{x:Type ItemsControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ItemsPresenter/> </ControlTemplate> </Setter.Value> </Setter> </Style> </cfx:LegendBox.ContainerStyle> </cfx:LegendBox> </cfx:Chart.LegendBox> JuanC
  19. Unfortunately we do not have a way for the transform to group based on scrollbars appearing on the legend, note that if the chart size (or the font used or the location of the legend box) is changed you might have to change your grouping and data transforms operate only once when the data is processed. If (and this might be a big IF) the size of the chart is constant as well as the style and font, you could use a transform that would only apply if the number of slices is bigger than a specified fixed amount (e.g. 10 in your sample, note that many factors will change this), If this sounds useful we could add a property to OtherTransform to support this functionality. JuanC
  20. In Bar/Area/Line charts you can control the point labels location by using the following properties chart1.AllSeries.PointLabels.VerticalAlignment chart1.AllSeries.PointLabels.HorizontalAlignment In the case of bars we also honor the following property chart1.AllSeries.PointLabels.Anchor Note that all these can also be set on a per-series basis (e.g. chart1.Series[0].PointLabels.VerticalAlignment) JuanC
  21. JuanC

    "Other" category

    Because the DataTransforms work at the binding label we will not pickup your labels if passed manually. Also there is a small bug (will be fixed in future builds) where an exception is thrown if you a pass a collection of numbers instead of passing a collection of objects. class DataItem { public double Value { get; set; } public string Label { get; set; } } chart1.Gallery = Gallery.Pie; chart1.Series.Clear(); chart1.Series.Add(new SeriesAttributes("Value")); chart1.AxisX.Labels.BindingPath = "Label"; List<DataItem> items = new List<DataItem>(); items.Add(new DataItem() { Value = 1, Label = "A" }); items.Add(new DataItem() { Value = 2, Label = "B" }); items.Add(new DataItem() { Value = 3, Label = "C" }); items.Add(new DataItem() { Value = 4, Label = "D" }); items.Add(new DataItem() { Value = 5, Label = "E" }); items.Add(new DataItem() { Value = 1.2, Label = "F" }); items.Add(new DataItem() { Value = 1.1, Label = "G" }); OtherTransform ot = new OtherTransform(); ot.MinPercentage = 10; ot.Text = "Other Countries"; chart1.DataTransforms.Add(ot); chart1.ItemsSource = items; JuanC
  22. JuanC

    Bullet chart

    Yes, it is already supported in the build you are running but you have to add a reference to ChartFX.WPF.Bullet.dll, then you will see the ChartFX.WPF.Galleries.Bullet class available. Other extensions (HighLow, Rose, WinLow, XYZ) are available as long as you add the appropriate reference. Also note that the VS 2008/Blend3 Design time wizard should allow you to use these extensions and it will automatically add the required references and modify your XAML. JuanC
  23. JuanC

    "Other" category

    The blog post in question is here. Note that OtherTransform will group small slices into the other category, this class is in the ChartFX.WPF.Data namespace and exposes a MinPercentage property as well as a Text property. JuanC
  24. No. It is NOT necessary to clear and re-add series when the style changes. You were simply requesting the series brushes before the palette was changed and additionally only changing some of the series brushes (last 5). So when the palette was changed you end up with the first 5 series using the new palette (because you never set their brushes) and the second 5 series having the color matching the first 5 colors of the PREVIOUS palette. JuanC
  25. About creating 2 legend boxes, we currently do not support this but you can use grouping and styling to achieve something very similar, the following code assumes you have 4 series in your chart. chart1.LegendBox.ItemAttributes[chart1.Series, 0].Group = "G1";chart1.LegendBox.ItemAttributes[chart1.Series, 1].Group = "G1"; chart1.LegendBox.ItemAttributes[chart1.Series, 2].Group = "G2"; chart1.LegendBox.ItemAttributes[chart1.Series, 3].Group = "G2"; chart1.LegendBox.GroupCategories = true; chart1.LegendBox.DockBorder = DockBorder.None; chart1.LegendBox.GroupStyle = (GroupStyle) FindResource("GroupBorder"); XAML <GroupStyle x:Key="GroupBorder"> <GroupStyle.ContainerStyle> <Style TargetType="{x:Type GroupItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> <Border CornerRadius="4" BorderBrush="#808080" BorderThickness="1" Margin="0,4"> <StackPanel> <TextBlock FontWeight="Bold" Text="{Binding Path=Name}" HorizontalAlignment="Center"/> <ItemsPresenter Margin="0,0,0,8"/> </StackPanel> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </GroupStyle.ContainerStyle> </GroupStyle> JuanC
×
×
  • Create New...