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, I am seeing an issue with the chart background when I slowly move the mouse cursor over the grid lines. Basically, if I move the mouse cursor over the the horizontal grid lines and begin to slowly move my mouse pointer down, my horizontal lines become invisible. If I reverse and move upwards the gridlines become visible. I am attaching a snapshot. Here is how I initialize the background this.ClearBackground(); var horizontalGridLineColor = (Color)TryFindResource("HorizontalGridLineColor"); Brush horizGridLineBrush = new SolidColorBrush(horizontalGridLineColor); var verticalGridLineColor = (Color)TryFindResource("VerticalGridLineColor"); Brush vertGridLineBrush = new SolidColorBrush(verticalGridLineColor); var backgroundMinorLinesGrid = new ChartGrid { Background = new SolidColorBrush((Color)TryFindResource("GridBackgroundColor")), Visibility = Visibility.Visible, Name = "MinorLinesGridGrid", MinorVerticalGridLineBrush = vertGridLineBrush, MinorHorizontalGridLineBrush = horizGridLineBrush, MinorVerticalDashArray = new DoubleCollection { 1.0, 1.0 }, MinorHorizontalDashArray = new DoubleCollection { 1.0, 1.0 } }; I have one more question. It seems like the chart slows down a bit when drawing a background. Any way you can improve this? Thanks, Peter |
|
|
Hello Peter I have not been able to reproduce this issue. There was a similar issue to this a while ago related zooming the chart rather than moving the mouse. Start by installing the latest nightly build as the issue may already be resolved. If this does not work, please let me know of any custom mouse interactivity you are performing on the chart. Also, when are you performing this grid line setup? does it only get run once, or are there situations where it gets refreshed? A repro project would greatly help me find the issue. Could you send us a new project with a simple chart and grid lines being setup in the same way you are doing now. The grid lines use virtualization and element recycling so I'm not sure if we can improve the performance even more for lots of grid lines. I've put this is on my list of things to look into though. Jason Fauchelle |
|
|
Hi Jason, The latest nightly build does not exhibit this behavior so it seems to be fixed(grid background). I had an old version of your chart. However, with the new version, I have noticed that the alternate axes don't get cleared. So for example I have an excel spreadsheet and when I select a row a chart gets displayed with 1 main axis and 5 alternate axes. When I click on another row I clear the collection of alternate axes and I can clearly see that they are cleared. However, I use snoop to spy on my xaml and I see they are still present. My use interface also displays them. Any ideas? Thanks, Peter |
|
|
Hello Peter Thanks for pointing out this issue. This will be resolved in the next nightly build. You may also be interested in the ChartAxis.Placement property which was added just recently. This lets you specify which side of the chart you want to display an axis. This could be useful if you don't want all alternate axes to be displayed on the right side. For some of the axes, you could set the Placement property to be left. Note that this is currently only supported by Y axes not the X axis. Jason Fauchelle |
|
|
Hi Jason, Thanks for the reply and I will try it tonight. I tried the chart placement and that's a great feature. However, I have some questions for you. I have a chart with 3 axes with left placement and 3 axes right placement. Is it possible to make an axis with a right placement as main y axis? I want to be able to click on an axis and that axis would become primary. Would I be able to setup my background where the horizontal and vertical lines correspond to the new main axis? Second question how do I set the tickmarks for the 2 axes that are to the left to have the same orientation as the main axis? And I have one more question. I subscribe to FinishedPlottingData however the handler gets called multiple times. Is there a way to tell when the chart finnished plotting? I use it to setup other charts which are dependent on this one. Thanks, Peter |
|
|
Hello Peter Yes you can set the primary axis to the right side. There is one limitation with trying to achieve the functionality you described though: IF the primary Y axis is on the left side, then it will always be placed closest to the chart. So if you want an alternate axis to be positioned closest to the chart on the left side, then the primary axis will need to be set on the right side. Also, the alternate axes are placed in a first come first served order. So you may also need to order the AlternateYAxes collection to get the correct axes positioned right next to the chart. If you find this difficult to manage, let me know and I'll see if we can add some kind of PlacementPriority property for the axes. The ChartGrid class has a YAxis and XAxis property. You can set the YAxis property to be the new 'primary' axis so the grid lines will be based on that axis. I'm not sure what you mean by setting the tick marks of the other 2 left aligned axis to have the same orientation as the main axis. Could you please send a screen shot of what it looks like now. Let me know what scenarios the event is being raised multiple times and I'll look into it. Jason Fauchelle |
|
|
Hi Jason, Thanks for the reply. Just add this event to the LargeDataSetChartDemo.xaml.cs public LargeDataSetChartDemo() { InitializeComponent();
the handler gets called 3 times but I am not sure why. Thanks, Peter |
|
|
Hello Peter I have looked at reducing the number of times the event is raised. I have dropped it down from 3 to 2, but the last call is a bit tricky to isolate. I've noted this down as something to look into again. The next nightly build will include the progress I have made so far. As for the issue with clearing the AlternateYAxes collection, it looks like the fix didn't go through the previous nightly build. This will be available in the next nightly build instead. Jason Fauchelle |
|
|
Hi Jason, Thanks for the update. The problem with alternate axes seems to be fixed. Thanks, Peter |
|