Jump to content
Software FX Community

Continous trend lines


selma

Recommended Posts

HI, Is there any way to create continous trend lines?

example data below:

Count Time Series

6   2007-03-15 00:00:00.000 CLOSED

1   2007-03-15 00:00:00.000 RESOLVED

8   2007-04-15 00:00:00.000 CLOSED

1   2007-04-15 00:00:00.000 OPEN

1   2007-05-15 00:00:00.000 CLOSED

1 2007-05-15 00:00:00.000 IN-PROGRESS

3   2007-05-15 00:00:00.000 OPEN

1   2007-05-15 00:00:00.000 RESOLVED

3 2007-06-15 00:00:00.000 OPEN

1   2007-06-15 00:00:00.000 RESOLVED

 

 If I plot this as a trend line with a categorical x axis (date/month), the series 'RESOLVED' breaks between March and May. Code given below:

DataSet ds = Getdata();

  DataTableProvider dt = new DataTableProvider(ds.Tables[0]);

  CrosstabDataProvider cfxCT = new CrosstabDataProvider();

  cfxCT.DataSource = dt;

  Graph.AxisX.Labels.Clear();

  Graph.AxisY.Labels.Clear();

  Graph.Gallery = Gallery.Lines;

  Graph.AxisX.Title.Text = ds.Tables[0].Columns[2].ColumnName;

  Graph.AxisY.Title.Text = "INCIDENT COUNT";

Graph.AxisX.Grids.Minor.Style = System.Drawing.Drawing2D.DashStyle.Dash;

Graph.AxisX.Grids.Minor.Color = Color.Gray;

Graph.AxisX.LabelsFormat.CustomFormat = "MMM-yy";

Graph.AxisX.MinorStep = 15;

Graph.AxisX.LabelAngle = 90;

Graph.AxisX.Step = 30;

  Graph.DataSourceSettings.Fields.Clear();

  Graph.DataSourceSettings.Fields.Add(new FieldMap(ds.Tables[0].Columns[2].ColumnName, FieldUsage.ColumnHeading));

  Graph.DataSourceSettings.Fields.Add(new FieldMap("Time", FieldUsage.RowHeading));

  Graph.DataSourceSettings.Fields.Add(new FieldMap("Incidents", FieldUsage.Value));

 

  cfxCT.Separator = "/";

  Graph.DataSource = cfxCT;

Chart given below:

Posted Image

Is there anyway to make this continous and assign a default value when there is none ?

 

Thanks,

Selma

Link to comment
Share on other sites

HI,

 Thanks  for that. That helps in joining the lines.

I was wondering if there is a way to force the chart to have a value = 0 for points that do not have a value actualy and then a line linking the dates.

Thanks for your time.

Selma

Link to comment
Share on other sites

Zero has no special meaning for Chart FX, so it will not fill any values with zero. When a value doesn't exist (like in the chart you were getting before your turned on CompressedXValues) it is filled with Chart.Hidden.

If you want you could go through the data and replace all values that have Chart.Hidden with zero.

Link to comment
Share on other sites

I tried doing the following for one hidden data point as a test, but it still did not show up on the chart : ( I turned off the CompressedXvalue setting)

  if (Graph.Data[0,2]== Chart.Hidden)

  {

  Graph.Data.[0, 2] = 0;

 

  }

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...