Jump to content
Software FX Community

Multiple Y Axis


kalyan_nani
 Share

Recommended Posts

Hi All,

I have a requirement.

My chart(Line Chart) has six series(Namely ser1,ser2,ser3,ser4,ser5,ser6).Among six series ser1 points to main Y axis.

My Requirement is i want to create multiple Y axis for each series( using AxisY2) without distrubing the main Y axis.

Can any one help me?

Regards,

Kalyan.P

 

Link to comment
Share on other sites

Hi Frank,

Finally i have an issue with X-Axis. The date is displaying as Jan'07 instead 01-Jan-2007.

I am using the following code to generate a datatable.

After creation of DataTable, it holds all 365 dates i added an interval of 30 days to X-Axis. 

Can you please suggest me the changes after looking in below code.

Thanks in Advance,

Kalyan.P

 

DataTable dtab = new DataTable("BudgetRep");

dtab.Columns.Add(

new DataColumn("BudgetVal", System.Type.GetType("System.Double"))); dtab.Columns.Add(new DataColumn("DailyVal", System.Type.GetType("System.Double")));dtab.Columns.Add(new DataColumn("remark_date", System.Type.GetType("System.DateTime")));

DsDate.Tables.Add(dtab);

DateTime dt = Convert.ToDateTime(repDate); // This repDate is a querystring value(in dd-mmm-yyyy format).int year = dt.Year;

int month = 1;int totdays = DateTime.DaysInMonth(year, month);

int i = 0, j = 0;for (i = 1; i <= 12; i++)

{

for (j = 1; j <= totdays; j++)

{

DataRow dr;

dr = dtab.NewRow();

string currdate = month + "/" + j + "/" + year;

dr[

"remark_date"] = Convert.ToDateTime(currdate);if (Bdgfound == false)

{

budgVal = getBudgetData(currdate);

dr["BudgetVal"] = budgVal;

}

else

{

dr["BudgetVal"] = budgVal;

}

if (Convert.ToDateTime(repDate) >= Convert.ToDateTime(currdate))

{

double d = getDailyData(currdate);dr["DailyVal"] = d;

}

dtab.Rows.Add(dr);

}

month = month + 1;

Bdgfound = false;if (month <= 12)

{

totdays = DateTime.DaysInMonth(year, month);

}

}

Chart1.DataSourceSettings.Fields.Add(new FieldMap("DailyVal", FieldUsage.Value));

Chart1.DataSourceSettings.Fields.Add(

new FieldMap("BudgetVal", FieldUsage.Value));Chart1.DataSourceSettings.Fields.Add(new FieldMap("remark_date", FieldUsage.XValue));

Chart1.DataSourceSettings.Fields[0].DisplayName =

"Daily";Chart1.DataSourceSettings.Fields[1].DisplayName = "Budget";

Chart1.AxisX.LabelsFormat.Format = AxisFormat.Date;

Chart1.AxisX.LabelsFormat.CustomFormat = "dd-MMM-YYYY";

Chart1.AxisX.Step = 30;

 

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.

 Share

×
×
  • Create New...