We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding ChartStripLine.SegmentStartValue and SegmentEndValue to DateTime instead of a double

Thread ID:

Created:

Updated:

Platform:

Replies:

111035 Sep 4,2013 09:16 PM UTC Sep 6,2013 05:40 AM UTC WPF 1
loading
Tags: Chart
Carlo
Asked On September 4, 2013 09:16 PM UTC

Hello, I have an SfChart representing some data, for which the X axis is a DateTime value (say it shows the days from a Monday August 1st to Sunday August 7th). Now, I want to add a strip line from the 3rd (Wednesday) to the 6th (Saturday), but as far as I can tell, I can't bind to DateTimes. Am I doing something wrong? Here's what I have. Thank you.

<chart:ChartStripLine Background="Red"
                        SegmentStartValue="{Binding StartTime}"
                        SegmentEndValue="{Binding EndTime}">
    <chart:ChartStripLine.LabelTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding}" />
        </DataTemplate>
    </chart:ChartStripLine.LabelTemplate>
</chart:ChartStripLine>

Muneesh Kumar G [Syncfusion]
Replied On September 6, 2013 05:40 AM UTC

Hi Carlo,

 

Thanks for using Syncfusion products.

 

We have analyzed your query. We would like to inform you that SegmentStartValue and SegmentEndValue properties types are double. So we need to give only double values for these properties. And we have to set IsSegmented property value as true to make ChartStripline segments, visible as per below code snippet.

 

Code Snippet[XAML]:

<syncfusion:ChartAxis.StripLines>

<syncfusion:ChartStripLine IsSegmented="True" SegmentEndValue="33" SegmentStartValue="15" Start="2" StartFromAxis="False" Width="413"></syncfusion:ChartStripLine>

</syncfusion:ChartAxis.StripLines>

 

We have prepared a sample based on this. Please find the sample from the following location.

 

Please let us know if you have any queries.

 

Regards,

Muneesh Kumar G.



ChartStripline_2911b453.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;