W.D Posted May 9, 2008 Report Share Posted May 9, 2008 I post this problem a while ago. Nobody replied. So I digged a bit further myself, but still not sure what's the problem. Initially I thought Gantt's AxisX is the vertical one, AxisY is the horizontal one. But when I use the code below to assign differnt color to the axis X and Y. I found the AxisX still is the horizontal one. I tried to change the Axis's Max to give more room to the pointlables. I tried both //Chart1.AxisY.Max=Chart1.AxisY.Max*1.1; //Chart1.AxisX.Max=Chart1.AxisY.Max*1.1; Only the "Chart1.AxisY.Max=Chart1.AxisY.Max*1.1;" is working. This somehow proves AxisY is the Horizontal one. After I change the Max Value, I found the Vertical Axis line disappears. That's very strange. Could anyone please help with this? Thanks a lot, W.D *************************************************************************** Chart1.Gallery = SoftwareFX.ChartFX.Gallery.Gantt; Chart1.AxesStyle=SoftwareFX.ChartFX.AxesStyle.Math; Chart1.AxisX.Visible=true; Chart1.AxisX.Line.Color=Color.Red; Chart1.AxisX.Line.Width=10; Chart1.AxisX.Line.Style=System.Drawing.Drawing2D.DashStyle.Solid; Chart1.AxisY.Visible=true; Chart1.AxisY.Line.Color=Color.Blue; Chart1.AxisY.Line.Width=10; Chart1.AxisY.Line.Style=System.Drawing.Drawing2D.DashStyle.Solid; Chart1.OpenData(SoftwareFX.ChartFX.COD.Values,1,3); Chart1.Legend[0]="Test1"; Chart1.Value[0,0] = 15; Chart1.Legend[1]="Test2"; Chart1.Value[0,1] = 20; Chart1.Legend[2]="Test3"; Chart1.Value[0,2] = 10; Chart1.CloseData(SoftwareFX.ChartFX.COD.Values); Chart1.RecalcScale(); Quote Link to comment Share on other sites More sharing options...
W.D Posted May 11, 2008 Author Report Share Posted May 11, 2008 I think I find a fix for my problem. To make a chart showing horizontal bars, it's not nessesary to be a Gantt. I could use Bar chart, and also the code below: Chart1.TypeMask = Chart1.TypeMask | SoftwareFX.ChartFX.ChartType.Horz; In this code, the problem (Vertical Axis invisible when re-setting Horizontal Axis's Max) can be avoided. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.