This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, We're currently using the WPF chart and are very impressed with the performance when using data sampling. One improvement we would like to request is as follows: Typically we have tens of thousands of data points we'd like to plot, so obviously that translates as many data points represented at the same horizontal pixel value. We can successfully use the PixelSpacing property to force for example two datapoints to be plotted on one pixel by using a spacing of 0.5, but we have no control over which two data points are displayed. Ideally what we'd really like to do is have the lowest and highest of all the data points that map onto a single pixel value displayed. In this way, we will see a true representation of the data range at that horizontal coordinate. Is there any way to enable this kind of functionality? Thanks, Peter |
|
|
Hello Peter In the next nightly build you will find a new property called IsMinMaxSamplingEnabled on the DataSeries class. By setting this to true, data will be plotted using a new sampling technique that considers min and max values in each sample space. I've tried this new feature on a trigonometry Tan function (which has lots of negative and positive spikes in the data) and viewed fantastic results of the rendered data. I've tried with 50,000 data points with the PixelSpacing property set to 0.5 and the performance was good. With a million data points, the rendering can lag noticeably for a split second every now and then while zooming the data. If you notice any lagging while zooming or resizing your chart, setting the PixelDensitySampler.IsZoomAdjustmentEnabled property to true can help this. Jason Fauchelle |
|
|
Thanks Jason! One more question I have for you. Is it possible to specify the line style for one series to be half solid and half dashed. At the moment we use two series to implement this functionality. Thanks, Peter |
|
|
Hello Peter Currently there is no built in feature to apply multiple styles to different ranges of the same series. You'll need to stick with different series to achieve this effect for now. Jason Fauchelle |
|
|
Hi Jason, I am experiencing a problem and I am not sure if I am doing something wrong. I am including 3 pics of the chart. The first chart pic basically displays some data plus some foregrounds elements. Basically, the chart only listens to FinishedPlottingData events to draw all the foreground elements. However, when I switch to a diferrent chart by selecting a new row on the grid I get what you see in secondchartbad image. I can see the FinishedPlottingData being called and all data for the axis max, min, actual max actual min actualwidth and actualheight are good ( I use them to draw the position of the foreground elements). However, minimizing and maximizing the application fixes the foreground(see secondchartgood). Note that when I switch between the charts I clear the foreground elements, the background, the series, the alternative axes and build it again. The other thing to note is that when selecting the grid with the bad foreground the plot data is the same the only difference is the foreground elements. The reason I am point this out is because if I select a row from the grid with different plot data I do not see this issue. Thanks, Peter I think I got to the bottom of it. I am using the axis actual width and axis actual height to calculate the locations of the foreground elements and when we get the finishedplotdata event fires these values are not quite right in the secondchartbad. One more thing. When I run in debug mode I cannot always reproduce it while in release mode I can always reproduce it. Thanks, Peter |
|
|
Hello Peter This bug was caused by some missing axis-size correction logic when the axes are dynamically swapped. This will be resolved in the next nightly build. Also, since several improvements have been made to the axis positioning and sizing logic over the past few months, I figured it's a good idea to give you updated versions of the custom axis templates you're using. These new templates help resolve off-by-one pixel alignment issues that you may or may not have seen. Also, these templates have a simplified visual tree, and they use a Grid instead of a StackPanel which could otherwise cause sizing issues. Note that these templates are based directly from the axis swapping sample that I sent you many months ago. You'll need to update them slightly based on the full customizations you've made such as the additional buttons. I've included comments so you can easily see their structure. Since they use a Grid instead of a StackPanel, you'll see some parts need to have Grid.Row and Grid.RowSpan properties set etc. Let me know if you have any questions.
Jason Fauchelle |
|
|
Thanks Jason!!! It's working nicely with the latest nightly build and your changes to the template. I have another question. Is it possible to control the label format at runtime as I zoom in and zoom out? How would I set it? Can I set it when I get the finish plot event? Thanks, Peter |
|
|
Hello Peter Firstly, I've fixed a potential bug that could prevent runtime changes to the label format property from instantly taking effect. This update will be available in the next nightly build. For your scenario, You can listen to the ChartAxis.RangeChanged event. This will be called whenever the ActualMinimum or ActualMaximum changes. Note that this means it will be called for both zooming and panning. Also note it will be called twice for a single zoom operation - once for each property change. Your event handler shouldn't be very complex so this shouldn't be a problem for performance. The other alternative would be to listen to the Chart.ChartZoomed event. This will only be called once per zoom operation, but it only gets raised by user-interaction, not programatic zooming, also this is a Chart-based event, whereas the RangeChanged event lets you target a specific axis. Choose which ever of these events you find easiest to use in your scenario. Either way, in the event handler you can check the logical distance between the ActualMaximum and ActualMinimum of the axis in question, and then change the LabelFormat property accordingly. Let me know if you need help. Jason Fauchelle |
|