Jump to content
Software FX Community

thubble

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by thubble

  1. I just tested with build 3442 - the first 2 bugs are fixed, but the third (label styling on highlight doesn't work until you move the scrollbar) is still a problem. I have a test app that reproduces this - I can send it to you if you'd like, just let me know where. Thanks.
  2. It looks like the above bug also happens when you use SetScrollView(). If you have a chart that does not have a scroll bar with the current ScrollView, then you change the data so that it needs a scrollbar (by adding more points) and call .Refresh(), it crashes with the error: "'Infinity' is not a valid value for property 'LargeChange'."
  3. While creating a test app to reproduce #3 (labels only work after you move the scrollbar) I found that it only happens if you manually set PixelsPerUnit on the axis. If this isn't set the problem in #3 doesn't occur, but the labels move all over the place (sometimes to the middle of the chart, over top of the bars) when you move the scrollbar. I suspect this might be related to the other problems. I can still send you the test app if you'd like, just let me know where to send it. Thanks again.
  4. Using version 3439 - AxisX.PixelsPerUnit works when you first set it (either through XAML or through Code) but if you change the data (either by assigning a new binding source or changing the existing one) it crashes with the error: "'Infinity' is not a valid value for property 'LargeChange'." This seems to happen mostly when there is a scrollbar showing on the X axis, but sometimes even when there's not. I've tried putting "AxisX.SetScrollView(0,0)" before changing the data, it still doesn't work. Any ideas?
  5. This still doesn't seem to work in version 8.0.3439.25180. Here's an example that doesn't seem to work properly: ------------------------------------------------------------------------------------------- <DataTemplate x:Key="AxisXTemplate"> <StackPanel HorizontalAlignment="Center" Orientation="Vertical"> <TextBlock x:Name="textContent" DockPanel.Dock="Right" Foreground="#FF0000FF" Text="{Binding Path=DataItem.PerformanceGroup}" VerticalAlignment="Center" /> </StackPanel> <DataTemplate.Triggers> <DataTrigger Binding="{Binding Path=Highlighted}" Value="True"> <Setter Property="TextDecorations" Value="Underline" TargetName="textContent" /> </DataTrigger> </DataTemplate.Triggers> </DataTemplate> <cfx:Chart x:Name="chtTest" ItemsSource="{Binding Path=TestData, ElementName=Window1Name}"> <cfx:SeriesAttributes BindingPath="Count" /> <cfx:SeriesAttributes BindingPath="Target" /> <cfx:Chart.AxisX> <cfx:Axis FontSize="11" FontFamily="Arial" Foreground="#FF0000" PixelsPerUnit="26" Template="{DynamicResource AxisXTemplate}" /> </cfx:Chart.AxisX> </cfx:Chart> ... Public ReadOnly Property TestData() As System.Collections.ObjectModel.ObservableCollection(Of TestDataRow) ... ------------------------------------------------------------------------------------------- This has a few problems: 1. It works OK when there is only one series, but with more than one series the highlighting doesn't work at all (mousing over one axis label will dim ALL bars and not highlight any). 2. The scrolling doesn't work properly - when you scroll, the label at the top doesn't go off the screen, it stays at the top and overlaps with the other labels as they scroll up. 3. The highlighting doesn't work at all until you move the scrollbar. Any ideas on this? Thanks in advance.
  6. I have a chart and I want to have the item highlighting such that not only the point bars, but also the axis labels, change appearance when the point is highlighted. The way I've done it is as follows: ----------------------------------------------------- Private Sub chtTest_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles chtTest.DataBound For i As Integer = 1 To chtTest.Data.X.Count Dim sec As New ChartFX.WPF.AxisSection() sec.From = CType(i, ChartFX.WPF.DataUnit) sec.To = CType(i, ChartFX.WPF.DataUnit) chtTest.AxisX.Sections.Add(sec) Next End Sub Private lastPoint As Integer = -1 Private Sub chtTest_Highlighting(ByVal sender As Object, ByVal args As ChartFX.WPF.HighlightingEventArgs) Handles chtTest.Highlighting Dim point As Integer = CType(args.Object, ChartFX.WPF.SeriesPoint).Point If args.Highlighting Then chtTest.AxisX.Sections(point).Foreground = Windows.Media.Brushes.Red chtTest.AxisX.Sections(point).FontWeight = FontWeights.Bold If (lastPoint >= 0) And (point <> lastPoint) Then chtTest.AxisX.Sections(lastPoint).Foreground = Windows.Media.Brushes.Black chtTest.AxisX.Sections(point).FontWeight = FontWeights.Normal End If lastPoint = point Else chtTest.AxisX.Sections(point).Foreground = Windows.Media.Brushes.Black chtTest.AxisX.Sections(point).FontWeight = FontWeights.Normal End If End Sub ----------------------------------------------------- This works for the most part, but it's kind of clumsy and setting the font to bold doesn't always work (I need to move the mouse a bit before it refreshes, even if I call chtTest.Refresh()). Is there a better way to do this? Ideally I'd like to do it using a template for AxisX, but I can't find a way to do this since the "Highlighted" property of the current point isn't accessible from the AxisX template. Also, there seems to be no way to make the text underlined since the TextDecoration property isn't exposed. Since the labels seem to be done with TextBlocks, is there a way to do this? Thanks in advance.
  7. The example code above seems to be for previous versions of ChartFX. Is there a way to have the scrollbar on the right side in ChartFX for WPF? I thought it could be done using a template for AxisX, but I'm not sure how. Thanks.
  8. I found a way to fix this: If chtTest.AxisX.ScrollBar IsNot Nothing Then AddHandler chtTest.AxisX.ScrollBar.ValueChanged, AddressOf AxisX_Scroll End If ... Private Sub AxisX_Scroll(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) chtTest.AxisX.ScrollPosition = chtTest.AxisX.ScrollBar.ValueEnd Sub Is there an easier/more elegant way to do this, though?
  9. I'm having a problem where I have a Gantt chart with a scroll bar on the X axis, and it is scrolling in the wrong direction. For instance, when the chart is first initialized, the points displayed are the top ones, but the scroll position is at the bottom. And when I move the scrollbar UP, it displays points farther down. I've tried putting a scrollbar on the Y axis and it works as expected. When I look at the AxisX.ScrollPosition and AxisX.Scrollbar.Value at any given time, they seem to be opposite. For instance, if I have 40 points, and AxisX.ScrollPosition is 10, then AxisX.Scrollbar.Value will be 30. Is there any way to reverse the direction of the scrollbar? Thanks in advance.
  10. In pre-WPF versions of ChartFX, there was the ability to hardcode the PixPerUnit value for the X axis so that when the chart is resized to be smaller, the number of points displayed will be constant until there are too many points to display at the current PixPerUnit value. In ChartFX for WPF, the PixPerUnit property seems to have been removed, so the only option is to use SetScrollView. The problem is that SetScrollView always sets the PixPerUnit based on the current size of the chart. So for example, if the chart is very large and there are only 2 points displayed, the points will be huge on the screen. This is fine, except that when the chart is made smaller, the points will remain huge and a scrollbar will appear with only one point displayed. Is there any way to preserve the old behaviour, i.e. that the points will get smaller until there are too many to display at the current PixPerUnit, and only then will the scrollbar appear? The only solution I've found is to call SetScrollView from the chart's SizeChanged event, and this is definitely not ideal. Thanks in advance.
×
×
  • Create New...