Jump to content
Software FX Community

Can't get XAxis Scrollbar to show


Recommended Posts

Hello.  I'm having difficulty getting the scrollbar to show for the X-Axis.

I've modified the AxisLabels sample application with the following XML resource file to read in.  It provides me with 100 data points.  I'm trying to set up the XAxis as a time based scale.  The major ticks are every 5 seconds.  Does the Step value have anything to do with why I can't get the scroll bar?

Here is the ReadChartData()

void ReadChartData(){ //string sXmlData = Properties.Resources.ProductSales; string sXmlData = Properties.Resources.TimeTest; XmlDataProvider cfxXML = new XmlDataProvider(); cfxXML.DateFormat = "MM/dd/yyyy HH:mm:ss"; cfxXML.LoadXml(sXmlData); try {   chart1.ExtraStyle |= ChartStyles.DoubleBuffer;   chart1.Gallery = Gallery.Curve;   chart1.AxisX.LabelAngle = 45; chart1.AxisX.Step = 5.787037083e-5;   chart1.AxisX.MinorStep = 1;   chart1.AxisX.LabelsFormat.Format = AxisFormat.Time;   chart1.DataSourceSettings.DataSource = cfxXML;   chart1.AxisX.AutoScroll = true;   chart1.AxisX.ScrollPosition = 50;   chart1.AxisX.SetScrollView(30, 40); } catch (Exception ex) {   MessageBox.Show(DateTime.Now.ToString() + "\n\n" + ex.Source + ": " + ex.Message); }}

Link to comment
Share on other sites

First off, thank you for the response. 

I gave it a try and I must still be doing something wrong.  I put the ScrollPosition = 50 and SetScrollView(30, 40) into the code earlier as guesses.

 Here is what I tried and still wasn't able to get the results.

  1. [*]Leave the code as it is.  I can change the chart Gallery to Bar chart and the scroll bar does appear.  I set the Gallery to Curve and the chart plots all data points onto the display.  I would like to force it to show only a subset of the data, say 30 points.

    [*]Here is what I attempted with using a DateTime value.

DateTime dtStart = DateTime.Parse("03/01/2007 08:43:09");
DateTime dtEnd = DateTime.Parse("03/01/2007 08:43:29");
//chart1.AxisX.SetScrollView(30, 40);
chart1.AxisX.SetScrollView(dtStart.ToOADate(), dtEnd.ToOADate());

Running the SetScrollView with the DateTime values ran slow.  Is that normal?  It seemed like the appication may have been frozen up for about 5 seconds, then the display changed to grey, please see attached picture.  If I were to right click on the chart and then disply the Toolbar the chart would refresh back to all data points on the display.



Link to comment
Share on other sites



I am also having the Same Problem. In my case i have Lables on X axis. And when

i tried to do SetScollView(0,5) on X axis, in order to show only first five lables and if user wants to see other he has to use scoll bar.

My application went into freeze mode. 

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...