private void Init2dChart()
{
nChartControl2.Settings.ShapeRenderingMode = ShapeRenderingMode.HighSpeed;
nChartControl2.Legends.Clear(); // no legend
NChart chart2d = nChartControl2.Charts[0];
NSmoothLineSeries surface = null;
if (chart2d.Series.Count == 0)
{
surface = (NSmoothLineSeries)chart2d.Series.Add(SeriesType.SmoothLine);
}
else
{
surface = (NSmoothLineSeries)chart2d.Series[0];
}
chart2d.BoundsMode = BoundsMode.Stretch;
NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)chart2d.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);
stripStyle.Interlaced = true;
stripStyle.SetShowAtWall(ChartWallType.Back, true);
stripStyle.SetShowAtWall(ChartWallType.Left, true);
linearScale.StripStyles.Add(stripStyle);
NSmoothLineSeries line = null;
if (chart2d.Series.Count == 0)
{
line = (NSmoothLineSeries)chart2d.Series.Add(SeriesType.SmoothLine);
}
else
{
line = (NSmoothLineSeries)chart2d.Series[0];
}
line.Name = m_map_name;
line.Legend.Mode = SeriesLegendMode.Series;
line.UseXValues = true;
line.UseZValues = false;
line.DataLabelStyle.Visible = true;
line.MarkerStyle.Visible = true;
line.MarkerStyle.PointShape = PointShape.Sphere;
line.MarkerStyle.AutoDepth = true;
line.MarkerStyle.Width = new NLength(1.4f, NRelativeUnit.ParentPercentage);
line.MarkerStyle.Height = new NLength(1.4f, NRelativeUnit.ParentPercentage);
line.MarkerStyle.Depth = new NLength(1.4f, NRelativeUnit.ParentPercentage);
//line.HorizontalAxes = y_axisvalues;
surface.Name = "Surface";
//surface.Legend.Mode = SeriesLegendMode.SeriesLogic;
//surface.PositionValue = 10.0;
for (int i = 0; i < y_axisvalues.Length; i++)
{
surface.XValues.Add(y_axisvalues.GetValue(i));
}
NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Nevron);
styleSheet.Apply(nChartControl2.Document);
}