User (Old forums)MemberApril 16, 2007 at 11:08 pmPost count: 23064
Cant’ get the chart to zoom the x axis when binding data with a date time scale on the x axis. The y axis zooms just fine. Suggestions to get the x axis to redraw with the correct max/min values from the zoom tool?
Imported from legacy forums. Posted by jonnio (had 5499 views)User (Old forums)MemberApril 25, 2007 at 3:26 pmPost count: 23064
There are also problems zooming with multiple y-axes, see the thread “Zooming with multiple y-axes”.
I’ve had a long standing request for these zooming problems to be fixed. The response on earlier thread was that this would be taken up with the developers (this was several months ago.)
Could someone please provide a status update? These are very annoying & embarrassing problems that users of my application face every day.
Thanks in advance.
Imported from legacy forums. Posted by JD (had 356 views)User (Old forums)MemberMay 17, 2007 at 12:33 pmPost count: 23064
This problem was investigated internally and with the help of a sample provided by jonnio, and we could not reproduce the issue. If someone can provide use with an application reproducing the DateTime axis issue, we will do the work to fix it.
Imported from legacy forums. Posted by André (had 416 views)User (Old forums)MemberMay 17, 2007 at 8:52 pmPost count: 23064
I have the same problem, I made a little example that reproduce it.
Here is all the code.
public partial class Form1 : Form
private void Form1_Load(object sender, EventArgs e)
private void InitChart()
DateTime from = new DateTime(2007, 05, 17, 0, 0, 0);
DateTime to = from.AddHours(12);
Chart m_Chart = chartControl.Charts;
chartControl.Settings.RenderDevice = RenderDevice.GDI;
Axis xAxis = m_Chart.Axis(StandardAxis.PrimaryX);
Axis yAxis = m_Chart.Axis(StandardAxis.PrimaryY);
xAxis.ScaleMode = AxisScaleMode.DateTime;
yAxis.ScaleMode = AxisScaleMode.Numeric;
xAxis.MinorGridLine.Pattern = LinePattern.Dot;
xAxis.MajorGridLine.Pattern = LinePattern.Solid;
yAxis.MajorGridLine.Pattern = LinePattern.Dot;
// Y Axis
yAxis.NumericScale.AutoLabels = false;
yAxis.NumericScale.AutoMax = false;
yAxis.NumericScale.AutoMin = false;
yAxis.NumericScale.Min = 0;
yAxis.NumericScale.Max = 9;
yAxis.NumericScale.RoundToTickMin = true;
yAxis.NumericScale.RoundToTickMax = true;
yAxis.Text.Font = new Font(“arial”, 7);
yAxis.AxisStyle = AxisStyle.Line;
yAxis.NumericScale.MajorTickMode = MajorTickModeNumeric.CustomStep;
yAxis.NumericScale.CustomStep = 1.0;
for ( int i = 0; i < 10; i++ )
// X Axis
xAxis.DateTimeScale.MajorTickMode = MajorTickModeDateTime.CustomStep;
xAxis.DateTimeScale.AutoMax = false;
xAxis.DateTimeScale.AutoMin = false;
xAxis.DateTimeScale.Min = from.ToOADate();
xAxis.DateTimeScale.Max = to.ToOADate();
xAxis.DateTimeScale.MinorTickCount = 2;
xAxis.DateTimeScale.RoundToTickMin = true;
xAxis.DateTimeScale.RoundToTickMax = true;
xAxis.DateTimeScale.CustomStep = TimeSpan.FromHours(1);
xAxis.ValueFormatting.Format = ValueFormat.CustomDateTime;
xAxis.ValueFormatting.CustomFormat = “HH:mm”;
xAxis.Border.Color = Color.Black;
xAxis.InnerTickLine.Color = Color.Green;
xAxis.OuterTickLine.Color = Color.Green;
xAxis.Text.FillEffect.Color = Color.DarkGreen;
xAxis.Text.Font = new Font(“arial”, 7);
xAxis.AxisStyle = AxisStyle.Bar;
private void btnZoom_Click(object sender, EventArgs e)
DataZoomTool zoomTool = new DataZoomTool();
Another problem that I have is when I refresh the ChartControl by any reason. The X values varies randomly from 0 to 12 some times and others from 0 to 13, even though
xAxis.DateTimeScale.Min=0 and xAxis.DateTimeScale.Max=12.
Imported from legacy forums. Posted by hernan (had 337 views)User (Old forums)MemberMay 21, 2007 at 2:11 pmPost count: 23064
What type of series are you using?
It would be best if you could send a working sample application that reproduces these issues to <a href=”mailto:firstname.lastname@example.org”>support</a> (with necessary steps to reproduce, if there is anything special), so we can investigate this further.
Imported from legacy forums. Posted by André (had 281 views)User (Old forums)MemberMay 21, 2007 at 3:46 pmPost count: 23064
I’m using LineSeries, but this problem happen even without series.
I’ll send the sample.
Imported from legacy forums. Posted by hernan (had 356 views)User (Old forums)MemberMay 28, 2007 at 3:00 pmPost count: 23064
The problem for the DateTimeScale was finally identified. It is zooming fine when using dates, the problem is when using time of day, then it does not zoom, as if the Chart is not able to handle this resolution.
Well, it is a behavior that is due to the minHorzPageSize property on the DataZoomTool itself. This property is set to 1 by default, and this works fine when using dates on a DateTimeScale, because days are represented by a value greater than 1 (when converted to an OADate). But when using time of day, which values are less the 1, you can easily see it will not zoom.
The solution is to simply set the minHorzPageSize to a value that will make sense for the resolution used for this scale, for example 15 minutes.
DataZoomTool zoomTool = new DataZoomTool();
DateTime span = new DateTime( 1, 1, 1, 0, 15, 0 );
float minHorzPageSize = System.Convert.ToSingle( span.ToOADate() );
zoomTool.MinHorzPageSize = minHorzPageSize;
chartControl.InteractivityOperations.Add( zoomTool );
Imported from legacy forums. Posted by André (had 6108 views)
- You must be logged in to reply to this topic.