Profile Picture

Reg: Negative Angles in Polar Point Charts

Posted By Ashis Mohapatra 4 Years Ago
Author
Message
Ashis Mohapatra
Question Posted 4 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 4 Years Ago
Posts: 2, Visits: 23
Hi Everyone, 

I have been using Nevron Polar Charts to plot data points at positive and negative swing angles. 
1. The angles of the chart start from 0-360 

2. Is there any way I can have the first and fourth quadrant as positive angles(0 - 180) and second and third quadrant with negative angles(-1 till -180) 

3. In short I want to mirror it from the centre ie. 0 deg
https://www.nevron.com/forum/uploads/images/72c7e574-140e-4da6-b350-353d.png




Nevron Support
Posted 4 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,000
Hi Ashis,

The only way to achieve this number is by using custom code - we could not find a way to achieve it with the standard .net format strings. The following code (which you need to paste in the code tab of the control) shows how to install a custom value formatter that formats all values after 180 degrees with their negative equivalent:

using System;
using System.Drawing;
using Nevron.Dom;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.ReportingServices;

namespace MyNamespace
{
  class NCustomValueFormatter : NNumericValueFormatter
  {
   public override string FormatValue(double value)
   {
    if (value > 180)
    {
      value = -(360 - value);
    }

    return value.ToString();
   }

   public override string FormatValue(object obj)
   {
    return FormatValue((double)obj);
   }
  }
/// <summary>
/// Sample class
/// </summary>
public class MyClass
{
/// <summary>
/// Main entry point
/// </summary>
/// <param name="context"></param>
public static void RSMain(NRSChartCodeContext context)
{
NPolarChart polarChart = (NPolarChart)context.document.Charts[0];

NAngularScaleConfigurator angularScale = (NAngularScaleConfigurator)polarChart.Axis(StandardAxis.PolarAngle).ScaleConfigurator;
angularScale.LabelValueFormatter = new NCustomValueFormatter();
}
}
}

We hope this helps - let us know if you meet any problems or have any questions.



Best Regards,
Nevron Support Team



Ashis Mohapatra
Posted 4 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 4 Years Ago
Posts: 2, Visits: 23
Thank you so much, it works perfectly. Smile 



Similar Topics


Reading This Topic