This project is read-only.

How to set X-axis Minimum value, X-Axis Maximum value and X-Axis Minimum Interval in individual TimeLineGraph?

Nov 25, 2009 at 12:22 PM

Hi,

                          Could you say how define X-axis values when constructing an individual graph (say TimeLineGraph)?. Normally,a TimeLineGraph does not show X-axis.So, I followed the instructions in the url "http://www.mscui.net/Blog/2009/04/default.aspx"  under the section "How to position the X-axis at the bottom the graph" to get the X-axis. But I could not see the entire graph because the Min X-axis duration is 1 minute. So it shows the variations in last 10 minutes.

                            How to set the X-axis Minimum value, X-Axis Maximum value and X-Axis Minimum Interval? Is that possible or not?

Regards,

Kaleth Quraizy

Jan 22, 2010 at 10:07 AM

hi Kaleth

Normally,a TimeLineGraph shows the X-axis. In order to not show too many X-axes in GraphHost, the TimeLineGraph control template has been overridden not to show X-axis and Horizontal scrollbar.

Can you please check if the TimeLineGraph declaration has Style property set? if yes can you please remove the style property and see whether the X-axis appears?

Also, X-axis minimum and maximum value are derived from the data and cannot be explicitly set. If you would like to customize the X-axis minimum interval, you would need to modify the source code. Please let us know what you would like to change here so that we can guide you.

Hope this helps

Regards

Tom Chapman

MSCUI Release Manager

Feb 13, 2010 at 5:48 AM

Hi tomchap and KalethQuraizy,

I am also trying to modify the x-axis interval but to a second based timespan. I have modified the tfc TimeFrequencyCollection to include 15 second and 30 second time spans.

 Then however when I load the page the control will freeze unless the default value is one of those listed by default am I missing something? In certain circumstances I get a divide by zero coming from an AxisHelper object.

It would be nice to avoid changing the source but if that is necessary I'd appreciate any tips on how to allow for second based time spans.

Cheers, Thomas Kefauver

 

Feb 15, 2010 at 5:07 PM

Hi Thomas

You will need to modify the GetAxisDesign method in AxisHelper.

If you look at the top of that method, the first test for the value of "timeSpanOfWindow" is for the smallest timespan we provided "5 Minutes":

 

if (timeSpanOfWindow == TimeSpan.FromMinutes(5))
...

 

You will need to add your two new timespans in there as follows to set the necessary axis properties:

 

if (timeSpanOfWindow == TimeSpan.FromSeconds(15))
{
    // 15 Seconds
    frequency.Unit = TimeFrequency.TimeUnit.Second;
    frequency.Value = 15;
    frequency.MajorUnit = TimeFrequency.TimeUnit.Second;
    frequency.MajorValue = 5;
    frequency.MinorUnit = TimeFrequency.TimeUnit.Second;
    frequency.MinorValue = 1;
    frequency.LabelFormat = GraphingResources.AxisHelperLabelFormatMinute;
    frequency.TitleFormat = GraphingResources.AxisHelperTitleFormatMinute;
}
else if (timeSpanOfWindow == TimeSpan.FromSeconds(30))
{
    // 30 Seconds
    frequency.Unit = TimeFrequency.TimeUnit.Second;
    frequency.Value = 30;
    frequency.MajorUnit = TimeFrequency.TimeUnit.Second;
    frequency.MajorValue = 15;
    frequency.MinorUnit = TimeFrequency.TimeUnit.Second;
    frequency.MinorValue = 5;
    frequency.LabelFormat = GraphingResources.AxisHelperLabelFormatMinute;
    frequency.TitleFormat = GraphingResources.AxisHelperTitleFormatMinute;
}
else if (timeSpanOfWindow == TimeSpan.FromMinutes(5))
...

 

 

Regards

Ben