Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

setting chart scaleview not working as expected

$
0
0

I am using the chart control as a bar chart linked to a data table and I am trying to set the chart show a single bar for one days worth of data.  The X axis is time series data and Y is a double.  Each day there is a single value logged against a specific datetime.

I was doing this with scaleview.zoom method which seemed to work initially when viewing a month or week of values but when viewing a single day I cant make it only show the single bar for that day.  It always shows two of three bars.  Some example code I was using for showing a single day is below.  I have spent a lot of time changing intervals, intervaltypes etc to try and find out if any of these settings would stop this for working correctly but to no avail.

DateTime dvMin = new DateTime(2012, 4, 12, 0, 0, 0);
DateTime dvMax = new DateTime(2012, 4, 12, 23, 59, 59);
chart1.ChartAreas[0].AxisX.ScaleView.Zoom(dvMin.ToOADate(), dvMax.ToOADate());

Any idea why this wouldn't work?

Thanks


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>