Author |
Topic  |
|
spencer_jones
1 Posts |
Posted - 26 Apr 2004 : 07:38:15
|
I have downloaded the demo version of the .NET charting tool to add a gantt chart to my application. I am having some problems creating the chart that I need and wondered if you have any specific samples for a gantt chart. I need an x-axis that provides more than just the year, i.e. the month and possibly the day (The sample of the float bar schedule has year only) and I would like to be able to have a scrollbar (for the x-axis only) within the chart to allow for a long timeline to be recorded. Finally :-) I like the fact that you can dynamically resize the horizontal bars on the chart but it would be useful if the cursor changed when the edge of the bar is hovered over. Is this possible?
Spencer Jones |
|
quinncurtis
1164 Posts |
Posted - 26 Apr 2004 : 09:08:02
|
The floating bar example (FloatingBarChart2) scale and resulting axes are set using auto scale routines, based on the underlying data. If you want to explicity override the auto axis routines then just set the scale limits that you want using the TimeCoordinates SetTimeScaleStart and SetTimeScaleStop methods.
TimeGroupDataset Dataset1 = new TimeGroupDataset("Stock Data",xValues,stockPriceData); pTransform1 = new TimeCoordinates(); pTransform1.AutoScale(Dataset1,ChartObj.AUTOAXES_NEAR, ChartObj.AUTOAXES_NEAR); ChartCalendar startdate = new ChartCalendar(1998,ChartObj.JANUARY,1); ChartCalendar stopdate = (ChartCalendar) startdate.Clone(); // Add 3 years to start date for stop date. stopdate.Add(ChartObj.YEAR, 3);;
pTransform1.SetTimeScaleStart(startdate); pTransform1.SetTimeScaleStop(stopdate);
The example program OHLCFinPlot uses a scroll bar to control the starting and ending points of a time scale. When you do this you must always make sure that you modify the endpoints of the scale, and the axes. This can usually be done using the CalcAutoAxis methods of the x- and y-axes, though the min and max of the axes can also be explicity set using the TimeAxis TimeAxisMin and TimeAxisMax properties.
xAxis1.CalcAutoAxis(); yAxis1.CalcAutoAxis(); xAxisLab1.CalcAutoAxisLabels(); yAxisLab1.CalcAutoAxisLabels();
We do not have built-in feature that changes the cursor when the edge of a bar is hovered over. It would be possible to override the MoveData methods to do something like you describe, though we have never created an example. |
 |
|
|
Topic  |
|
|
|