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 All, I'm trying to draw a horizontal line on a line chart. The chart I'm working needs an upper range line, lower range line and a standard line. Anyone know how to draw a line at a given Y point on the graph? I've attached a picture of the results that I need to generate. Thanks! Bruce |
|
|
Hello Bruce You can achieve this by adding instances of StripeLine to the ForegroundElements collection property of the Chart control. Set the orientation to Horizontal, and set the StartValue to the logical Y value where you want to render the line. You can also customize the style and display content such as a label next to the line. Let me know if you have any questions about using this. -Jason Fauchelle |
|
|
Jason, Thank you! That worked like a charm. The only thing left is to do the shading, I think I can use the same line and then a style to get the gradient. If that doesn't work then I'll come back and ask for more help. Thanks Again, this was a life saver, I need to show the client something tomorrow. Best, Bruce |
|
|
Jason, I have another question about the StripeLine (or maybe something else). Here's what I need to do: On a line graph starting with the y axis going from 73 - 89 I need to draw a line at 83, and then have that line cover the points from 79 to 85. I've already got the StripeLine showing up behind the lines on the graph, but always getting it to display from 79 to 85 is escaping me. Any suggestions? Thanks! B |
|
|
Hello Bruce Is this to get a similar effect to the green gradient in the background of the image you posted? If so, you can use StripeLine to do this too. Set the StartValue to 79 and Set the EndValue to 85. The set the StripeStyle property to be a Style targeting Rectangle, and set the Fill to be the green gradient, and set StrokeThickness to 0. Hope that helps. -Jason Fauchelle |
|
|
Hello Jason, I was trying to simplify the problem... The line needs to be drawn at the mean point for the graph, I have the calculations to do that, then then I need to show 2 standard deviations up and down (that's the green fading color). So what's going to happen is as new data points are added to the chart the mean line will go up and down and the Standard deviation can shift. I don't know how to translate from the standard deviation to the graph to get things lined up correctly. Thanks! Bruce |
|
|
Hello Bruce It sounds like the StipeLine is still what you need to do this. The StartValue and EndValue properties of the stipeLine are expecting logical plot positions which is what your SD value will be. You can bind the StartValue and EndValue properties of the StripeLine to your model so that you can manipulate them as the data changes and you calculate the new SD value. I think you want the StartValue to be the mean - SD, and the EndValue to be mean + SD. Also, keep in mind that you'll want to plot the mean line with one StripeLine, and plot the SD range with a different StripeLine. If it seems I have misunderstood your goal and you need further assistance, feel free to post more image examples of what you want to implement. Or send me your project (or a repro project) to jason@mindscape.co.nz and I'll have a quick look at what you need to do. -Jason Fauchelle |
|