I am attempting to display date/time along an X axis, quantity of 'events' on the Y.
Here's the pertinent bit from InitializeComponent()
//
// cht
//
//
//
//
this.cht.Legend.IsWindowLess = false;
this.cht.Legend.Location = new System.Drawing.Point(675, 42);
this.cht.Legend.TabIndex = 1;
this.cht.Legends.Add(this.chtAuditEvents.Legend);
this.cht.Location = new System.Drawing.Point(220, 576);
this.cht.Name = "cht";
this.cht.Size = new System.Drawing.Size(768, 112);
this.cht.TabIndex = 91;
//
//
//
this.cht.Title.Name = "Def_title";
this.cht.Title.Size = new System.Drawing.Size(8, 8);
this.cht.Title.TabIndex = 2;
this.cht.Title.Visible = false;
this.cht.Titles.Add(this.cht.Title);
this.cht.ToolBar.ButtonFlatStyle = System.Windows.Forms.FlatStyle.Popup;
I add this data (8:20/2, 8:21/4, 8:22/4, 8:23/17) in the format of DateTime (dtStart)/long (lEventQty) to a series:
seriesProcess.Points.Add(dtStart, lEventQty);
At the conclusion of creating that series, we set the type and add it to the chart:
seriesProcess.Type = ChartSeriesType.Line; this.cht.Series.Add(seriesProcess);
this.cht.PrimaryXAxis.ValueType = ChartValueType.DateTime; this.cht.PrimaryXAxis.DateTimeFormat = "hh:mm"; cht.PrimaryXAxis.LabelRotate = true; cht.PrimaryXAxis.LabelRotateAngle = 45;
When the series type is set to 'ChartSeriesType.Line', everything displays properly. When the type is set to 'ChartSeriesType.Column' I get what appears to be a very odd display (see attachment) of the information; does anyone have some insight on why the grid is acting so oddly?
Best,
-Drew Johnson
chart_f162508b.zip