Group: Forum Members
Last Active: 12 Years Ago
Posts: 1,
Visits: 1
|
Hi,
I was trying to update my project Nevron references from Q1 2007 to Q1 2012. However, I confronted a scale problem. So I tried to update references one-by-one and found the version causing it.
Problem Definition: In my project with Q1 2012 I have seen that polar charts are displayed as compressed in default small view with respect to Q1 2007. When I enlarge the view by dragging the edge of view, it looks like normal as in Q1 2007. Thus, I have written a sample code and tested it. Here is the possible problem: I want to display my polar chart as the chart in 'Sample Q2 2008.png'. Hovewer, when I upgrade the version to Q3 2008, I have to use NPolarAreaSeries. If I don't change my linearScaleConfigurator, chart is displayed as in 'Sample Q3 LinearScaler 2008.png'. Why is it smaller than the previous version display? Moreover, when I use NAngularScaleConfigurator, chart is displayed as in 'Sample Q3 AngularScaler 2008.png'. Why is it compressed?
The code below is the sample code that produced displays in the attachments.
Code : public Form() { InitializeComponent();
NLabel header = nChartControl1.Labels.AddHeader("Polar Area"); header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic); header.ContentAlignment = ContentAlignment.BottomRight; header.Location = new NPointL(new NLength(2, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));
NPolarChart polarChart = new NPolarChart();
nChartControl1.Charts.Clear(); nChartControl1.Charts.Add(polarChart);
polarChart.DisplayOnLegend = nChartControl1.Legends[0];
NAxis axisX = polarChart.Axis(Nevron.Chart.StandardAxis.Polar); axisX.Visible = this.Visible;
//axisX.ScaleConfigurator = new Nevron.Chart.NAngularScaleConfigurator(); //((Nevron.Chart.NAngularScaleConfigurator)axisX.ScaleConfigurator).LabelStyle.Angle = new Nevron.Chart.NScaleLabelAngle(Nevron.Chart.ScaleLabelAngleMode.View, 0); axisX.ScaleConfigurator = new Nevron.Chart.NLinearScaleConfigurator(); ((Nevron.Chart.NLinearScaleConfigurator)axisX.ScaleConfigurator).LabelStyle.Angle = new Nevron.Chart.NScaleLabelAngle(0);
NAxis axisY = polarChart.Axis(Nevron.Chart.StandardAxis.Polar); axisY.Visible = this.Visible;
//axisY.ScaleConfigurator = new Nevron.Chart.NAngularScaleConfigurator(); //((Nevron.Chart.NAngularScaleConfigurator)axisY.ScaleConfigurator).LabelStyle.Angle = new Nevron.Chart.NScaleLabelAngle(Nevron.Chart.ScaleLabelAngleMode.View, 0); axisY.ScaleConfigurator = new Nevron.Chart.NLinearScaleConfigurator(); ((Nevron.Chart.NLinearScaleConfigurator)axisY.ScaleConfigurator).LabelStyle.Angle = new Nevron.Chart.NScaleLabelAngle(0);
NPolarAreaSeries polarAreaSeries = new NPolarAreaSeries(); //NPolarSeries polarAreaSeries = new NPolarSeries(); //polarAreaSeries.Style = Nevron.Chart.PolarStyle.FilledArea;
polarChart.Series.Add(polarAreaSeries);
polarAreaSeries.HorizontalAxes = new int[] { axisX.AxisId }; polarAreaSeries.VerticalAxes = new int[] { axisY.AxisId };
polarAreaSeries.FillStyle = new Nevron.GraphicsCore.NColorFillStyle(Color.LightSteelBlue); polarAreaSeries.MarkerStyle = new NMarkerStyle(); polarAreaSeries.MarkerStyle.PointShape = PointShape.Sphere; polarAreaSeries.MarkerStyle.Width = new NLength(5); polarAreaSeries.MarkerStyle.Visible = true; polarAreaSeries.Name = "asdasdasd"; polarAreaSeries.DataLabelStyle.Visible = false;
GenerateData(polarAreaSeries, 100, 15.0); }
private void GenerateData(NPolarSeries series, int count, double scale) { series.Values.Clear(); series.Angles.Clear();
double angleStep = 2 * Math.PI / count;
for (int i = 0; i < count; i++) { double angle = i * angleStep; double c1 = 1.0 * Math.Sin(angle * 3); double c2 = 0.3 * Math.Sin(angle * 1.5); double c3 = 0.05 * Math.Cos(angle * 26); //double c4 = 0.05 * (0.5 - Random.NextDouble()); double value = scale * (Math.Abs(c1 + c2 + c3));
if (value < 0) value = 0;
series.Values.Add(value); series.Angles.Add(angle * 180 / Math.PI); } } }
|