MayorDateTimeLabelProvider Needs GridBackground and RectangleBorder Brush properties

Oct 30, 2009 at 10:22 PM
Edited Oct 30, 2009 at 10:34 PM

Hi guys,

I just got a taste of this project 3 days ago. I am using it for showing timeline activity for a one minute rolling timeline just something like Windows TaskManager CPU Usage History. It works great, BUT the MayorDateTimeLabelProvider sets the above Brushes to Brushes.Beige and Brushes.Peru and it is hard coded. I had to insert two properties there and that way I can set the background on it as:

HorizontalDateTimeAxis axis = TimelineChart.HorizontalAxis as HorizontalDateTimeAxis;
DateTimeAxisControl axisContent = axis.Content as DateTimeAxisControl;
MayorDateTimeLabelProvider horizontalAxisLabelProvider = axisContent.MayorLabelProvider as MayorDateTimeLabelProvider;
horizontalAxisLabelProvider.GridBackground = Brushes.AliceBlue;
horizontalAxisLabelProvider.RectangleBorder = Brushes.CornflowerBlue;

If there is an easier way, can someone fill me in on it? And if not, can this be added?

Thanks.

 

I just have to add: Great stuff here. Thanks.

 

Editor
Oct 31, 2009 at 3:33 AM

Hi,

Thanks for your opinion about our project)

 

Next changeset in 'Source code' page will contain such properties:

 

<d3:ChartPlotter Name="plotter">
<d3:ChartPlotter.MainHorizontalAxis>
<d3:HorizontalDateTimeAxis MayorLabelBackgroundBrush="AliceBlue" MayorLabelRectangleBorderProperty="DarkBlue"/>
</d3:ChartPlotter.MainHorizontalAxis>
</d3:ChartPlotter>

 

<d3:ChartPlotter Name="plotter">
	<d3:ChartPlotter.MainHorizontalAxis>
		<d3:HorizontalDateTimeAxis MayorLabelBackgroundBrush="AliceBlue" MayorLabelRectangleBorderProperty="DarkBlue"/>
	</d3:ChartPlotter.MainHorizontalAxis>
</d3:ChartPlotter>

A little more at http://microsoft.cs.msu.su/personal/thecentury/Public%20Documents/Wiki/D3.html#%5B%5B31%20October%202009%5D%5D

Best regards,

Mikhail.

 

 

Editor
Nov 1, 2009 at 4:54 PM

Now these properties are available in 'Source code' page, in changeset 29226.

Mikhail.

Nov 2, 2009 at 3:22 PM

Thank you Mikhail, very fast response and great implementation as DependencyProperty.

 

Thanks again.

 

noorbakhsh