Zorkon Posted November 25, 2008 Report Share Posted November 25, 2008 How can I create a new line style for each series. The following does not work: _prodAndInjChart.Data.Series = chartData.Columns.Count - 2;_prodAndInjChart.Data.Points = chartData.Rows.Count; for (int seriesCount = 0; seriesCount < chartData.Columns.Count; seriesCount++) { double dataPoint; DateTime dateTime;for (int pointCount = 0; pointCount < chartData.Rows.Count; pointCount++) { if (seriesCount == 0) {_prodAndInjChart.AxisX.Labels[pointCount] = DateTime.TryParse(chartData.Rows[pointCount][seriesCount].ToString(), out dateTime) ? dateTime.ToShortDateString() : Convert.ToString(chartData.Rows[pointCount][seriesCount]); } else{ if (chartData.Columns[seriesCount].ToString() == Common.PortalConstants.ChartMetrics.ASSET_TYPE) { if (chartData.Rows[pointCount][seriesCount].ToString() == Common.Enums.AssetType.Commercial.ToString()) _prodAndInjChart.Series[seriesCount].Line.Style = System.Drawing.Drawing2D. DashStyle.Dash; else_prodAndInjChart.Series[seriesCount].Line.Style = System.Drawing.Drawing2D.DashStyle.Solid; }_prodAndInjChart.Data[seriesCount, pointCount] = double.TryParse(chartData.Rows[pointCount][seriesCount].ToString(), out dataPoint) ? dataPoint : 0.0;_prodAndInjChart.Points[seriesCount, pointCount].Text = string.IsNullOrEmpty(Convert.ToString(chartData.Rows[pointCount][seriesCount])) ? "0" : Convert.ToString(chartData.Rows[pointCount][seriesCount]); AxisY newAxis = new AxisY();newAxis.Position = AxisPosition.Near; newAxis.Title.Text = chartData.Columns[seriesCount].ColumnName; newAxis.Title.TextColor = _prodAndInjChart.Series[seriesCount].Color; newAxis.TextColor = _prodAndInjChart.Series[seriesCount].Color; _prodAndInjChart.AxesY.Add(newAxis); _prodAndInjChart.Series[seriesCount].AxisY = newAxis; _prodAndInjChart.Series[seriesCount].Text = chartData.Columns[seriesCount].ColumnName; } } } Quote Link to comment Share on other sites More sharing options...
Zorkon Posted November 25, 2008 Author Report Share Posted November 25, 2008 I figured out the problem Quote Link to comment Share on other sites More sharing options...
dayiku Posted September 3, 2009 Report Share Posted September 3, 2009 Please share 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.