This project is read-only.

How to customize start and enddate for the date axis (x-axis)

Mar 6, 2013 at 11:16 AM
I build my own DynamicDataDisplay.dll from ZoomSliderSample project (with some changes for zooming and panning like try catches for some critical paths)
Soon i want to customize the stat an end of the x-axis from year 0 - 9999 to first entry of graph to last entry of graph.
is that possible? and if yes can you give me an advice?

thanks and best regards lodkarma.
Mar 6, 2013 at 3:33 PM
OK first idea
changes in DateTimeAxis:
//public static readonly long minTicks = DateTime.MinValue.Ticks;
//public static readonly long maxTicks = DateTime.MaxValue.Ticks;
public static long minTicks = DateTime.MinValue.Ticks; //only default
public static long maxTicks = DateTime.MaxValue.Ticks; //only default
public void setMinDate(DateTime date){minTicks = date.Ticks;}
public void setMaxDate(DateTime date){maxTicks = date.Ticks;}
and no "readonlys"

new in main:
dateAxis.setMinDate(new DateTime(2013, 3, 1, 12, 0, 0));
dateAxis.setMinDate(new DateTime(2013, 3, 10, 12, 0, 0));

probelm: to change AxiControl too cause Range<T> are wrong (out of DateSpan)
Mar 7, 2013 at 3:02 AM

This link may help.
double xMin = this.dateAxis.ConvertToDouble(DateTime.Now.AddMinutes(-20));
double xMax = this.dateAxis.ConvertToDouble(DateTime.Now.AddMinutes(2));
Rect visibleRect = new Rect(xMin, -1000000000, xMax - xMin, 4000000000);
this.plotter.Viewport.Visible = visibleRect;
Mar 7, 2013 at 2:26 PM
Mm not really.
With your code snippet you zoom in a special part of the chart.
That alters the view but not the chart itself.
I want to change the origin of the first quadrant of the chat from (01.01.0001,0) to e.g (07.03.2013) and the end of the x-axis from 31.12.9999 to e.g 31.3.2013

ps now i understand the zooming ^^ thx. if the is no other way i permit to zoom e.g in dates before 07.03.2013 but its not the best way.

best regards lodkarma.