Jump to content
Software FX Community

Gantt Chart's AxisX and AxisY, which is which?


W.D

Recommended Posts

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();
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...