Note from the attachment we have drawn a blue and black line (2 line series). We then add a RangeAreaSeries to color the area between the lines gray. The upper series of the range is constructed from the greater values of the two line series and the lower series from the lesser values.
We are having two problems:
1. As you can see, the gray area is not always precisely contained within the lines near where the lines cross each other. This is due to switching from one series to the next and the space between points. It's not likely this can be fixed unless there is a different way to color between lines.
2. We would like to color the range in two different colors: one color when the blue line is above the black line and a different color when the blue line is below the black line. RangeAreaSeries does not support this. It can be done with one line above and below zero, using a positive and negative brush, but we haven't figured out a way to do it with two lines.
Any suggestions?
Jim
Jim, The crossing is happening there because you don't actually have a data point at the crosspoint, so the line series are interpolating in either direction and the interpolations cross. But to the range series it will always just take the maximum of the high and low value to be the high value, so it doesn't appear to the range area series that the range has closed to 0 unless that data point where there high and low are equal is actually present. Nevertheless, I think there might be a way you can achieve the display you want, let me see what I can do.
First though, Jim, are you using the CategoryXAxis or CategoryDateTimeXAxis?
Graham,
Two series is brilliant! I can create one range series for when blue is on top. Its top value = blue value and bottom value = black value if blue > black. Else, top value = bottom value = blue value. And, reverse for when black on top. This actually seems to work. congrats.
We still have the issue where the color bleeds at the crosses but maybe we can minimize that by adjusting the formulas above to track to the line a bit ahead of time.
As to volume, not sure what you mean. Do you mean quantity of X points?
Cool, glad it works ;-)
yes, Jim, quantity is what I mean.
Here's a snippet of a chart implementing your suggestion of using 2 Range Series. As you see, it works. There are, however, a few areas near crossovers that get a bit messy for the reasons we discussed earlier in this post.
Our X-axis varies from a few points to maybe 1000 points.
Hi Jim,
It looks like you and Graham have resolved your questions but I was wondering if you had any follow-up quesitons that I could help you with.
There is still the issue of not coloring between the lines, as you can notice on the most recent image.
While this solution will mostly work, a more robust solution would perfectly color between the lines. We haven't worked with the new Custom Series yet, but wondered if that might work here. Otherwise, it may have to be a feature request.
Hi,
You're very welcome. In fact we're glad to have suggestions so that we can keep improving the products.
Thanks Marianne for submitting the requests. We look forward to improving this solution when the new features are available.
I believe that Graham suggested creating a custom series in this case might require an excessive amount of code because "too much of the range category series stuff is internal".
So I have created a new product idea requesting the addition of the UnknownValuePlotting property and DontPlot to the range series. As Graham suggested this would modify the crossing and positive/negative behavior to accomdate your design needs. This idea and the details you and Graham were discussing has been submitted directly to our Product Management team.
Our product team chooses new feature requests for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products so as trends appear in requested features, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your features are chosen for development you will be notified at that time. Your reference number is PI12070151. Please let me know if you have any questions.