Profile Picture

Upgrading from Nevron Chart v3.1 to Nevron .NET Chart 2016.1

Posted By Lance Levendowski 8 Years Ago

Upgrading from Nevron Chart v3.1 to Nevron .NET Chart 2016.1

Author
Message
Lance Levendowski
Question Posted 8 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: 6 Months Ago
Posts: 60, Visits: 157
I'm converting a project that uses Nevron Chart v3.1 to Nevron .NET Chart 2016.1.  Can somebody please tell me the properties, methods, or events in Nevron .NET Vision 2016.1 that correspond to the following items in Nevron Chart v3.1?

  Nevron.NChart.NChart.BeforePaint
  Nevron.NChart.NChart.AfterPaint

  Nevron.NChart.WinForm.NChartControl.Settings.RenderDevice

  Nevron.NChart.NAxis.DimensionScale.AutoLabels
  Nevron.NChart.NAxisScaleDimension.AutoLabels

  Nevron.NChart.NChart.PredefinedChartStyle
   NOTE: Nevron.Chart.NChart.SetPredefinedChartStyle can be used to set the value, but how can you get the current value?
   Example:
    Dim chart As Nevron.NChart.NChart
    Dim desiredPredefinedChartStyle As Nevron.NChart.PredefinedChartStyle
      '...
     If (chart.PredefinedChartStyle <> desiredPredefinedChartStyle) Then
       chart.PredefinedChartStyle = desiredPredefinedChartStyle
        ' Run additional code here that is required when chart.PredefinedChartStyle is set to a new value.
     End If

  Nevron.NChart.NAxis.TitleText.Offset
  Nevron.NChart.NAxis.TitleText.HorzAlign
  Nevron.NChart.NAxis.TitleText.VertAlign

  Nevron.NChart.NSeries.DataLabels.DrawEvery

  Nevron.NChart.NChartWall.FillEffect.Emissive

Thank you for any help!


Nevron Support
Posted 8 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: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009

Hi Lance,

The following guidelines should help you port the application:

Nevron.NChart.NChart.BeforePaint
  Nevron.NChart.NChart.AfterPaint
Check out the All Examples \ Custom Painting - the main idea is that you need to create a callback class. The following topic in the documentation shows how to achieve this:
http://helpdotnetvision.nevron.com/UsersGuide_Miscellaneous_Custom_Painting.html


Nevron.NChart.WinForm.NChartControl.Settings.RenderDevice

Property is now called render surface
nChartControl1.Settings.RenderSurface = RenderSurface.Window;

  Nevron.NChart.NAxis.DimensionScale.AutoLabels
  Nevron.NChart.NAxisScaleDimension.AutoLabels

The following code shows how to apply custom labels to the X axis:
            NOrdinalScaleConfigurator scaleX = (NOrdinalScaleConfigurator)chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator;
            scaleX.AutoLabels = false;
            scaleX.Labels.Add("One");
            scaleX.Labels.Add("Two");


  Nevron.NChart.NChart.PredefinedChartStyle
   NOTE: Nevron.Chart.NChart.SetPredefinedChartStyle can be used to set the value, but how can you get the current value?
   Example:
    Dim chart As Nevron.NChart.NChart
    Dim desiredPredefinedChartStyle As Nevron.NChart.PredefinedChartStyle
      '...
     If (chart.PredefinedChartStyle <> desiredPredefinedChartStyle) Then
       chart.PredefinedChartStyle = desiredPredefinedChartStyle
        ' Run additional code here that is required when chart.PredefinedChartStyle is set to a new value.
     End If

There is no way to get the predefined style - you can however simply have a field in the form that hosts the control that stores the currently applied predefined style.

  Nevron.NChart.NAxis.TitleText.Offset
  Nevron.NChart.NAxis.TitleText.HorzAlign
  Nevron.NChart.NAxis.TitleText.VertAlign

The axis title poperties are exposed from the scale configurator attached to the axis:
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator.Title.Offset = new NLength(10);
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator.Title.RulerAlignment = Nevron.HorzAlign.Left;

  Nevron.NChart.NSeries.DataLabels.DrawEvery

This property is no longer present in the control. You can however assign individual data label styles to data points - for example:

            NChart chart = nChartControl1.Charts[0];

            NBarSeries bar = new NBarSeries();

            bar.DataLabelStyle.Visible = false;

            bar.Values.Add(10);
            bar.Labels.Add("");

            bar.Values.Add(20);
            bar.Labels.Add("Has Label");
           
            NDataLabelStyle labelStyle = new NDataLabelStyle();
            labelStyle.Visible = true;
            labelStyle.Format = "<label>";
            bar.DataLabelStyles[1] = labelStyle;

            bar.Values.Add(20);
            bar.Labels.Add("");

            chart.Series.Add(bar);

  Nevron.NChart.NChartWall.FillEffect.Emissive

chart.Wall(ChartWallType.Back).FillStyle.MaterialStyle.Emissive = Color.Yellow;

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



Best Regards,
Nevron Support Team



Lance Levendowski
Posted 8 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: 6 Months Ago
Posts: 60, Visits: 157
That was very helpful.  Thank you!

Just one followup for now:
Nevron Chart v3.1 had the following properties:
Nevron.NChart.WinForm.NChartControl.Settings.RenderDevice of type Nevron.GraphicsCore.RenderDevice
Nevron.NChart.WinForm.NChartControl.Settings.RenderSurface of type Nevron.GraphicsCore.RenderSurface

Nevron .NET Chart 2016.1 has:
Nevron.Chart.WinForm.NChartControl.Settings.RenderSurface of type Nevron.GraphicsCore.RenderSurface
The Nevron.GraphicsCore.RenderDevice enumeration still exists in 2016.1, but I don't know of any properties that implement this type.

Is it possible or necessary to specify Nevron.GraphicsCore.RenderDevice.OpenGL vs Nevron.GraphicsCore.RenderDevice.GDI in 2016.1, or is that determined by the value of the RenderSurface property (i.e., RenderSurface.Bitmap always uses RenderDevice.GDI and RenderSurface.Window always uses RenderDevice.OpenGL)?



Nevron Support
Posted 8 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: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Lance,

The rendering technology is automatically determined by the control - when you specify RenderSurface.Bitmap the combination is GDI+ for 2D charts and OpenGL in software mode for 3D charts. This mode is also used when the control generates images on the server. It is also completely compatible with all hardware as the rendering is done on the CPU. RenderSurface.Window on the other hand is pure OpenGL in both 2D and 3D with hardware acceleration (GPU rendering).


Best Regards,
Nevron Support Team



Lance Levendowski
Posted 8 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: 6 Months Ago
Posts: 60, Visits: 157
Makes sense.  Thank you for the explanation.



Similar Topics


Reading This Topic