Hi,
I would like to know how to use the Strip line in the XamDataChart. I would like to add different colour bands on the chart according to the data in the chart? Can anyone please advise me on this function?
Thanks,
Pieter
Pieter, you can set a brush on the Strip property on both axes. You should pick a color with some transparency (change the alpha value) and you will see a neat effect on the strip crossing. But are you talking about putting the strip at a configurable set of values? We don't directly support this, but I may be able to help you out with a sample. Could you explain in more detail what you are trying to do?
-Graham
Hi Graham,
Thanks again for replying.
I am adding an image this is just an example of what I should do. There is a trace on the graph if it drops below 0 it should make the background red, if it stays on a point for longer than 10 minutes the background must be orange and the last one if it goes above 20 it must change the background to green. My problem is I don’t know how to do this checks in XAML and I don’t know what function to call in C#?
I will appreciate any advice on this. The XAML code is the same as my other post on the X Axis.
Thank You!
Aha. I was using a CategoryXAxis when I should have been using a CategoryDateTimeXAxis with the DateTime MemberPath set.
My strips are not drawing. Do you have any idea why the GetScaledValue function would return numbers like 1.1378021398827587E+18 for a date of 11/1/2011 1:00:00 AM (634557060000000000 Ticks), a window {0,0,1,1}, and a viewport {0,0,467.99,277.04}? That's the end date. The start date is 7/20/2011 1:00:00 AM (634467204000000000 Ticks) scales to 1.137641022222069E+18. I don't think this function is behaving correctly. Do you happen to have a scaling function that works correctly?
An approach like above presented needs to be more complicated in order to deal with that kind of volume. Is there a sample that you can provide that replicates your scenario? I may be able to point out how you can adjust this extension in order to perform well with that level of annotation. But, as a warning, the code is likely to be more complicated.
Performance is absolutely horrendeous on these strips. I have a chart with 2000 points and 200 annotations like this.
For anyone else interested, Graham's solution relies on XamDataChart events firing to refresh strips which you may need to address when the chart is set as the XamZoombar preview content.
Additionally the GetScaledValue calls rely on x axis ActualMinimumValue and ActualMaximumValue having meaningful values, which in my situation was not the case. This is easily overcome by implementing your own scaling method.