Jump to content
Software FX Community

Series Line Styles


Zorkon
 Share

Recommended Posts

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;

}

}

}

Link to comment
Share on other sites

  • 9 months later...

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...