ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Regarding Zooming & scrolling
Posted by Sai on Nov-07-2012 22:54
I am writting application in MFC and using ChartDirector library. I have tow cases.

1. In one chart X-axis contains Strings and Y axis contains number. I want to know how do I zoom my chart & how do I add scrolling to my chart. In this chart I have to huge data along x-axis. Let say 1000 of X-axis values. And in chart client area I want to show only 50 points along x-axis. So in this chart hoe do I add scroll bar without zooming.

2. In one chart X-axis contains Time which is hh:mm:ss: ms(mili second) and Y axis contains number.How do I show time in millisecond format? I want to know how do I zoom my chart & how do I add scrolling to my chart & how do I add scroll bar.

  Re: Regarding Zooming & scrolling
Posted by Peter Kwan on Nov-08-2012 00:38
Hi Sainath,

1. I have just replied to your other message with an example for zooming and scrolling with a label based x-axis. I have specified configure the code so that it will not show more than 50 labels on the x-axis, even if you zoom out and thousands of data points are displayed. (The code will select no more than 50 labels and put them on the x-axis.)

http://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_general&thread=1352297169&new_thread=1


2. If your x-axis is "time", you may use Axis.setLabelFormat to format the date/time. For example:

c->xAxis()->setLabelFormat("{value|hh:nn:ss.fff}");

The documentation on "Axis.setLabelFormat" contains a link to a page "Parameter Substitution and Formatting" that describes the format string.

Please note in ChartDirector, "date/time" refers to "date/time" as expressed in the programming language (not in human language). For example, in Java, it is java.util.Date, and in .NET, it is System.DateTime. However, in C++, the programming language does not have something called date or time. So in ChartDirector for C++, ChartDirector uses it own date/time format. You may look up "Date Representation" in the ChartDirector documentation index for details.

http://www.advsofteng.com/doc/cdcpp.htm#dateformat.htm

The original "Zooming and Scrolling with Track Line (1) (MFC)" is an example of how to perform zooming and scrolling with a date/time x-axis.


Hope this can help.

Regards
Peter Kwan