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
|
Hi There, When you zoom to some point the axis tick mark and value disappeared. See attached image from your sampling code. Thanks Gordon |
|
|
Hello Gordon In the sample explorer this is the expected default behavior. When the axis auto-calculates the spacing between the labels/tick marks, the smallest possible spacing will be the smallest difference between adjacent data points. The idea behind this is that there is no point zooming in further than the closest adjacent data points because all you will see is a single line or point. This minimum spacing idea is also very useful for bar series where there should only be one tick mark between each bar or at the center of each bar. Another reason this is useful is when rendering string values along the axis - The minimum spacing of labels should be 1 so that it doesn't start rendering multiple labels with the same string. You will also find that the tick marks are still being rendered. If you pan the chart left or right, you will see a tick mark and label appear. The spacing between them just happens to be larger than the viewport. In your application, do you have a scenario where the labels and tick marks all suddenly disappear even though the chart is not fully zoomed in? It is possible for the chart to stop drawing labels and tick marks if it is forced to render too many. This can be caused by manually setting the MajorTickSpacing property or the DateTimeIntervalDefinitions of a DateTimeAxisValueConverter in a way that results in many tick marks being rendered for a particular range. Jason Fauchelle |
|
|
Thanks Jason, All the remarks from your first paragraph are making sense. But in our situation is kind different, in the image you can see we have 2 different set point in and the grid line and tick marks disappeared. We always set the min, max and MajorTickSpacing property. Our customer does not like the scrollbar on the axis so we cannot pan the graph. I remember that when we set the binding for min max values we have to use TwoWay binding (set in code), otherwise it will not working, is this still the case? Thanks, Gordon |
|
|
Hello Gordon It is best to have a TwoWay mode on Minimum, Maximum, ActualMinimum and ActualMaximum values because zooming, panning and constraint logic can cause these properties to be set internally. In WPF, if a property with a OneWay binding is directly set to be a value, the binding is removed and replaced with the set value. But if it is a TwoWay binding, the binding will be kept. The most likely reason that the tick marks are no longer rendering is that you could be setting the MajorTickSpacing property to render too many tickmarks. To prevent the application from locking up for a long time, we included a mechanism to abort the axis rendering. Debug your chart and calculate (ActualMaximum - ActualMinimum) / MajorTickSpacing. This will be how many tick marks you are trying to render. If this is very large, you'll need to adjust the MajorTickSpacing value to get a better number of tick marks. Without scrollbars, the user can still pan the chart by holding Ctrl and dragging the mouse (unless the chart is at 100% zoom of course). Jason Fauchelle |
|
|
Hi Jason, In our graph, when you zoom, the y axis tick mark automatically change the label value but, the x-axis does not change accordingly, please see the attached images: nozoom.jpg and zoomzaxis_problem.jpg. I understand if there is too many ticks you don't want to render it, but the problem is that tick marks does not change the same way in x-axis and y-axis. Gordon |
|
|
Hello Gordon Thanks for the images, these explain the situation further, but I have not been able to reproduce this issue. The closest I can get is setting AllowMajorTickSpacingZoomAdjustment to False and TickMarkMode to Stationary on the X axis, but this still renders at least on tick mark and label. Please let me know the value of ActualMinimum, ActualMaximum, MajorTickSpacing and any other options you have set on the X axis at the time the tick marks disappear. Jason Fauchelle |
|
|
Hi Jason, MajorTickSpacing is only set once at beginning, during/after zoom I did not change it (on the graph I give it to you is xMIn=0; xMax=1.2 and MajorTickSpacing = 0.2). I never set the ActualMinimum, ActualMaximum at all, I tried to set it once but it causes more trouble than good. Here is the data for one of the lines:
Thanks, Gordon |
|
|
Hello Gordon I have not been able to reproduce this issue. I worded my question badly. Please run your application and cause the grid lines to disappear, and then look at the ActualMinimum, ActualMaximum and MajorTickSpacing properties that the ChartAxes has and then let me know what those values are. (MajorTickSpacing may be modified by the chart which could be a bug). Also, please let me know all property values that you are setting on the ChartAxis (except for min, max and MajorTickSpacing cause I already know those). Jason Fauchelle |
|
|
Hi Jason, At beginning Min=0, Max=60 and MajorTickSpacing =5.0 for x-axis and min=0.2, max=2.2 and MajorTickSpacing=0.2 for Y-Axis. After zooming: ActualMin=16.512, ActualMax=19.67 and MajorTickSpacing=5.0 for x-axis and ActualMin=0.95, ActualMax=1.04 and MajorTickSpacing = 0.2 for y-axis. Surprisingly, the MajorTickSpacing is not changing. The Y-Axis is acting normal but x-axis is not. See the screenshot. The following is the data:
|
|
|
Hello Gordon On the X Axis, are you setting AllowMajorTickSpacingAdjustment to be False? This is the only way I've been able to reproduce the problem with this data. Jason Fauchelle |
|
|
Thanks Jason. I did not set the value at all for both x-axis and y-axis. Whatever the default value is, I used that value. I try to set it to true (the default is true) and still the same problem. I will send you reproducing project together with the Histogram problem. The trick is if you have 2 different scatter series in the plot to reproduce it. Gordon |
|
|
Hi Jason, Here is the re-producing projects for zoom problem. 1) Unzip the file 2) Run the application 3) Click on Add Scatter Curve button 4) Zoom between 2 tick marks on x-axis, you will see the problem. Gordon |
|
|
Thanks for the repro project Gordon The axis spacing calculation will be improved in the next nightly build to resolve this issue. Jason Fauchelle |
|
|
Thanks Jason, June 28, 2013 build fix the problem Gordon |
|
|
Hi Jason, We download the July 31 2013 nightly build, and this problem comes back again. When there is no scatter series, and only have lineSeries, after zooming the x-axis tick mark disappeared. see the image beforeZooming.jpg and afterZooming.jpg. (note: the Y-axis is reversed and x axis on top, not sure if Y- not reversed and x-axis on bottom will have same problem or not, I guess you have to test it out. X and Y are regular doubles not datetime field). Also, if we have bar graph (See barBeforeZoom.jpg ) when zoom to some extend with no tick marks or only one tick mark on the y-axis(see image barZoomToExtend.jpg) , then un-zoom to 100%, the tick marks label will not come back(see image barAfterZoomAndBack100.jpg) , you need to refresh by changing the window size for it to re-appear. Could you put this situation in your testing bank so that it will not re-appear each time you change the code? Thanks Gordon |
|
|
Hello Gordon The tick mark issue is actually a different (but similar) bug that has been around for a while. This is caused when the chart only has 2 data points which you're line chart probably has. This has been resolved and tested which will be available in the next nightly build. Thanks for pointing this out. I tried set up a bar chart in the same way as the images that you posted, but was unable to reproduce this issue. I can't see how this is even possible. I'll have another go at reproducing this tomorrow. If you can provide any more information about how to reproduce it, that would be great. Jason Fauchelle |
|
|
Hi Jason, We have new problem now, If I have a barseries, or any series with string value on one or both axis (Only bar series has uneven grid after zoom). It may have something to do with the fixes you have on this thread. 1) If did not set the CustomTickValues and Min/Max/Interval, then some of the bar is not at tick makrs as for example in Minimum in the BarProblemBeforeZoom.jpg. 2) Now if I set CustomTickMarks and Min=0, Max=Bar Count -1 and GridSpacing is 1, before zooming, it is ok, then after zooming, there are too many labels and grid lines. I can get rid of the repeat labels by changing the converter, but the grid line are the problem, see the effects on barproblemAfterZoom.jpg You can use the following data:
And the converter used like this:
I can change the function to get rid of repeat label as the following:
We really want to use option 2) here, Please fix them and we really need a version soon for us to release our products The complete code is in the project,.zip on this thread. Thanks, Gordon |
|
|
Hello Gordon Thanks for pointing this out. This bad behavior has been in the charts for a while, but usually there isn't a chance for this to occur. Indeed one of the changes I made on this thread uncovered this bad behavior. I've finally worked out how to resolve this once and for all which will be available in the next nightly build. Tests will prevent this from occurring again. By the way, did you resolve the other bar chart zooming issue you had on this thread? Jason Fauchelle |
|
|
Hi Jason, I downloaded the Aug 07 nightly build and It did not fix the problem. The grid lines for bar still not even. And also, sometimes the tick label disappeared. Gordon |
|
|
Hello Gordon I may have misunderstood the actual issue. I resolved the issue of zooming in so that it does not display multiple labels so that option 2 will work better. Please send a screen shot of the uneven bars and missing labels and describe how this occurs and I'll quickly fix this up for you. Jason Fauchelle |
|
|
Hi Jason, On the screenshot, see the y-axis label disappeared and the grid line is even in the middle of the graph but not in the top and bottom which is close to the x-axis. Thanks Gordon |
|
|
Hello Gordon Thanks for the image. I just realized that using a converter will prevent the axis from knowing that the data is made up of strings. Try setting AllowMajorTickSpacingZoomAdjustment to false on the Y axis. Jason Fauchelle |
|
|
Hi Jason, Tried set to false and still the same results. Gordon |
|
|
Hello Gordon I have not been able to reproduce this if AllowMajorTickSpacingZoomAdjustment is false. Make sure that you are still setting MajorTickSpacing to 1, and also try remove the duplicate label fix from the converter. Jason Fauchelle |
|
|
Hi Jason, as most of time only we can reproduce but I really don't have time to do that. Used your suggestion and using Aug. 7 nightly build, the problem getting worse as see in the image attached. Frustrated me. |
|
|
Hello Gordon I have attached a sample to help track down this issue. To run the sample, make sure to include a reference to your WpfElements dll. As you can see I've set the MajorTickSpacing to 1 and the AllowMajorTickSpacingZoomAdjustment to false on the YAxis. When zooming the chart it works as expected. Please modify this sample to reproduce the problem and send it back. I have a feeling that I may be using your converter incorrectly. Jason Fauchelle |
|
|
Hi Jason, Aug. 7, 2013 nightly build seemed fix the problem, I may use the Aug 6th nightly build before and I will do more test tomorrow and if our QA did not find major fault on datagrid and chart, this will be our final version for this release. In the future, if you can make AllowMajorTickSpacingZoomAdjustment as DependencyProperty it will be nicer, but for now, I am happy with it. Thanks Gordon |
|
|
Hello Gordon Great to hear it is working now! I have made a note to change that to a dependency property for you. Jason Fauchelle |
|