DateTime axis

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

steunissen wrote at 2011-11-17 13:39:

I am trying to get it to work but I don't succeed:

 

I want to display outside temperatures for a complete year with 1 hour interval values. (so I have 8760 value pairs).

for the horizontal axis I use a DateTime axis. But I have trouble setting the right settings for the horizontal axis.

I've set the MajorStep to 0.125 to display the majorgridlines each 3rd hour.

But I don't get the Minor gridlines to display. (settting MinorStep to 0.04166666666)

<TabItem Header="DateTime (XAML)">
            <oxy:Plot Title="DateTime axis (XAML binding)" Margin="20">
                <oxy:Plot.Axes>
                    <oxy:DateTimeAxis Position="Bottom"
                                      StringFormat="MMM-ddd-HH"
                                      MajorGridlineColor="Black"
                                      MajorGridlineStyle="Solid"
                                      MajorGridlineThickness="1"
                                      MajorStep="0.125"
                                     
                                      
                                      MinorGridlineColor="Red"
                                      MinorGridlineStyle="Solid"
                                      MinorGridlineThickness="1"
                                      MinorStep="0.041666666666"
                                      
                                      />
                </oxy:Plot.Axes>
                <oxy:Plot.Series>
                    <oxy:LineSeries ItemsSource="{Binding Data}"
                                    DataFieldX="Date"
                                    DataFieldY="Value"
                                    StrokeThickness="1"
                                    MarkerSize="3"
                                    MarkerType="Plus"
                                    TrackerFormatString="Time: {2:yyyy-MM-dd HH:mm:ss}&#x0a;Value: {4}" />
                </oxy:Plot.Series>
            </oxy:Plot>
        </TabItem>

 

 

 

Any suggestions ?


objo wrote at 2011-11-18 06:19:

I checked in a little change that let you set the MinorStep on the DateTimeAxis.