|
Can we use scroll event in simple line chart or compact line chart , if yes then how |
Posted by Rajesh Kushare on Feb-07-2009 20:06 |
|
hi ,
Please tell me that we can use scroll event or not in compact line chart .
because i have to show 20 million records , it is not possible to how in single event , so
i need the scroll event in chart . |
Re: Can we use scroll event in simple line chart or compact line chart , if yes then how |
Posted by Peter Kwan on Feb-07-2009 22:51 |
|
Hi Rajesh,
Yes. Scrolling in the simple line chart or the compact line chart is the same as scrolling as shown in the "Zooming and Scrolling demonstration". There is virtually no difference, except the "decorations" (such as the background color, chart size, font style, etc).
I suggest you may start with the "Zooming and Scrolling demonstration". The sample code uses random numbers as data. You may modify the code to use your real data instead. After it works, if you want to use the style of the "Simple Line Chart", you may change the chart style (eg. remove the rounded frame and chart title and legend box, and remove the background color, etc) to your preferred style.
Should you need further information, please feel free to contact me.
Regards
Peter Kwan |
Re: Can we use scroll event in simple line chart or compact line chart , if yes then how |
Posted by Rajesh Kushare on Feb-09-2009 17:46 |
|
I need some example in which use of horizontal scroll in compact line graph ,
because there is no point to show the millions records in small image.
By using the scoll we divide the graph in parts , i want to know how to use scroll in compact line graph .
Please send such example if any one have .
Regards & Thanks ,
Rajesh Kushare. |
Re: Can we use scroll event in simple line chart or compact line chart , if yes then how |
Posted by Peter Kwan on Feb-10-2009 00:51 |
|
Hi Rajesh,
The standard "Zooming and Scrolliing Demonstration" and "Zooming and Scrolling Demonstration (2)" are already the same code that demonstrates how to show in a line graph. The main difference between the charts in these sample code and the "compact line graph" is the colors, chart size, and font sizes, etc... If you change the chart colors and font sizes, etc., they will be the same as the "compact line graph".
If you want me to change the colors and chart sizes, etc., for you, please inform me what is your programming language and application type (eg. desktop application or web application, etc). I will modify the "Zooming and Scrolliing Demonstration" to the same style as the compact line chart.
Regards
Peter Kwan |
Re: Can we use scroll event in simple line chart or compact line chart , if yes then how |
Posted by Rajesh Kushare on Feb-10-2009 11:59 |
|
Hi Peter,
Thanks for the soln. I use jsp for showing this graph.
So I need jsp code for compact line that uses the scroll event. i saw the zooming and scrolling demo but it only zooms the current graph but i need horizontal scroll bar and using scroll i will change the xy value of the graph.
Regards & Thanks ,
Rajesh |
Re: Can we use scroll event in simple line chart or compact line chart , if yes then how |
Posted by Peter Kwan on Feb-10-2009 16:38 |
|
Hi Rajesh,
The sample code that comes with ChartDirector illustrate how to scroll the chart, either dragging the chart itself, or by using external HTML controls with Javascript.
For example, in "Zooming and Scrolling Demonstration", there are drop down list boxes that controls the starting date (if your increment or decrement the start date, the chart effectively scrolls).
In "Zooming and Scrolling Demonstration (2)", the "Navigation pad" at the bottom left corner can scroll the chart in 2D.
In real applications, many developers use other HTML controls or user interface to scroll the charts. If you want to use your own user interface (eg. a "scroll bar"), you would need to create the scroll bar with your own code. In the "scroll event" of the scroll bar, you may call the ChartDirector API to scroll the chart, just like what we do in the sample code.
In summary, if the example you need is how to use a "scroll bar" to scroll the chart, unluckily, we do not have sample that demonstrates using a "scroll bar". You may need to developer your own code for the "scroll bar". In the scroll event of the scroll bar, you may call the ChartDirector API to scroll the chart.
In the simplest example, in your scroll event, you may determine the position of your scroll bar as a ratio to the scroll bar length. Then you may call:
var viewer = JsChartViewer.get('<%=viewer.getId()%>');
viewer.setViewPortLeft(myScrollBarPosition);
viewer.applyHandlers("ViewPortChanged");
Hope this can help.
Regards
Peter Kwan |
|