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
|
Dear: I have a question, can you help me? Thanks! The "CurveAndHistogram.zip" is my sample in the attach files. In the project, you can find the xaxis of histogram chart is error. In the "CurveAndHistogram.jpg", you can find the xaxis of curve chart is right, and the xaxis of histogram chart is error. Can you tell me, how to solve it? Thanks! |
|
|
Hello, By default, bar charts cause the labels on the independent axis to be placed between the major tick marks. To make the XAxis of the histogram look the same as the curve chart, set LabelLayout = Normal on the XAxis of the histogram. Let me know if you have further questions about this. -Jason Fauchelle |
|
|
Hi Jason Fauchelle, In yesterday's project, I set LabelLayout = Normal on the XAxis of the histogram. I can make the XAxis of the histogram look the same as the curve chart. Thanks! However, If I use the property of CollectionBinder.SynchronizedSelectedItems to binding the data, the XAxis of the curve chart is right, but the XAxis of the histogram chart is error. In "CurveAndHistogramTwo.jpg", you can find the XAxis of "Particle size(um)Curve(One)", "Particle size(um)Histogram(One)" and "Particle size(um)Curve(Two)" is right, the XAxis of "Particle size(um)Histogram(Two)" is error. In the attach files, the "CurveAndHistogramTwo.zip" is my new project. Can you tell me how to solve it? Thank you very much! _Rui Xu |
|
|
Hi Rui Xu, Thanks for the repro project. For the top histogram, the series gets added first which causes the XAxis LabelLayout to change to Inside. But since LabelLayout is also set in xaml, it then overrides the value back to Normal. In the bottom histogram, the LabelLayout property is being set first. The series is then added in code later which then causes the LabelLayout to be set to Inside - overriding the value you set in xaml. Since the default value is Normal, by the time the series is added, there is no way to know if it was set by you - so we can't add logic to halt the override if you set the property. One option could be to set the LabelLayout of the XAxis in code just after you add the series to the Chart. This is just after line 513 of MainWindow.xaml.cs in your repro project. You can get the XAxis instance through the XAxis property of the series. The only other alternative to setting the LabelLayout in code would be to add the series in xaml (like the top histogram) - not sure how that would work (or if that's possible) with your attached property. Let me know if you have further questions. -Jason Fauchelle |
|