I have a sparkline in a time bar, and I am looking to match the x values of the sparkline with the times of the timebar. Currently, the first item in the sparkline is always shown at the start of the timebar, no matter if the times match or not. Is there a way I can do this?
3 Answers, 1 is accepted
answered on 18 Jul 2012, 07:21 AM
To achieve the desired effect you need to set two properties: timeBar1.PeriodStart and timeBar1.PeriodEnd. For the first one, you have to set the same DateTime which comes in first in the ItemsSource of the SparkLine. For the other one, the last DateTime from the ItemsSource of the SparkLine. If the generic collection is sorted you can do something similar to the one in the code snippet below. I hope this helps.
What if I wanted to have two sparklines showing, one that occours from 10:00AM to 3:00PM and one from 11:00AM to 2:00PM, and I wanted to have them appear in the correct locations? Or, for example, I wanted some white space on the side of the sparkline so it's easier to zoom in to the edges of the sparkline.