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, I want to plot the histogram, if it is discrete, I want to have label on x-axis under each bar. In order to do that, I set x-axis TickLayout = Normal and LabelLayout = Normal. Pass in the X property of my point as string. In order for me to show the label correctly, I need to set x-axis Min/Max/MajotTickSpacing as: Min = 0; Max= The number of points, MajorTickSpacing =1; I have class MyPoint with X property as string and Y property as double type:
and the points are:
It will have extra column at the end on the plot and label 4, see the screen as HistogramProblem1.png If the value is (double quote is from data, i.e. point.X="\"shutin0well.inc\"")
It leaves a column at beginning and the order of the bar is not the order of my points (it put bar "shutin1well.inc", 35 at the end). Please see HistogramProblem2.png If I get rid of the double quotes, then I am amazed what it will looks like, see HistogramProblem3.jpg Please advise what should I do. I am using 5.0 June 24th 2013 Nightly build. Thanks, Gordon |
|
|
Hello Gordon The first issue is simple - you are setting the maximum of the X axis to be the number of data points. With your example data (with 4 data points), this would mean the axis would show 0,1,2,3,4. That is 5 values. For the first 4 values, it uses the string provided by each value. But for the last value (4), it has run out of data, so all the axis can do is display the index (4). To resolve this, you could either set the maximum to data count - 1, or don't set any of the values in order for the chart to automatically work them out. For the second issue, in your previous repro projects, I have seen the use of a ValueConverter set on an axis that converts strings to and from logical axis plotting positions. Are you using this such converter in the chart images you posted? From what I remember, your converter contains a list of strings. When getting the logical plot position for a particular string, it simply returns the index of that string within the collection, or returns 0 if the string is not found in the collection. If you removed the quote marks from the strings in your data, but not from the list of strings in the value converter, then this would explain why all the bars in your 3rd image are stacked in the same place. Since none of the strings match up anymore, they'll all return 0 from the ValueConverter. This may also explain why they appear in a strange order in the 2nd image. I don't recommend using this converter. If this however is not the case, please describe how to reproduce the problem. Jason Fauchelle |
|
|
Hi Jason, For the 2nd and 3rd issue, you were right, I am using the converter. I will find out if I do not use the converter what we happen tomorrow. We are getting later in canada. Thanks Gordon |
|
|
I tried without using custom tick marks and it solved my problem. For some of the plot I do need to use it though because I want ("push", 1) and ("Push", 1) as the same. So it will end up ("Push", 2). Thanks a lot. Gordon |
|