Articles in this section
Category / Section

How to display striplines in DateTimeAxis of WPF Chart?

1 min read

To display striplines on a DateTimeAxis in a WPF chart, you must first convert the desired date-time value into a double and assign it to the Start property of the chart striplines. Below is an example demonstrating this process:


Code snippet 

<chart:DateTimeAxis FontSize="14" 
Interval="1" 
IntervalType="Days"                        LabelFormat="dd/MMM/yyyy">         <chart:DateTimeAxis.StripLines>            <chart:ChartStripLines>                 <chart:ChartStripLine x:Name="stripLine"  
Width="1"                                                           Background="Yellow"
Opacity="0.5"/>            </chart:ChartStripLines>         </chart:DateTimeAxis.StripLines>  </chart:DateTimeAxis>   

 

The width of the striplines is determined based on the axis interval.

 

stripLine.Start = new DateTime(2009, 1, 3).ToOADate(); 

Output

The screenshot below shows the expected output when the above code is implemented.

DateTimeStripline in WPF Chart.


Conclusion

I hope you enjoyed learning how to display striplines in DateTimeAxis of WPF Chart.

You can refer to our WPF Chart feature tour page know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF Chart Examples to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied