Profile Picture

Radial Gauge Indicator help needed

Posted By moh aziz 14 Years Ago
Author
Message
moh aziz
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 4, Visits: 1

hi,

i have currently installed .net vision Q3 2008.

firstly why is it that i cannot use the api in a web application and the tools are only available on forms app.

ok i want to use the radial guage indicator with live data from a sql database. i cannot find it from the tools menu option.

hence i selected NChartControl from the nevron chart windows from toolbar. but when i go to wizard there is no option for radial gauge.

please help.



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

Hi,

 

We would recommend you to use the latest version of Nevron .NET Vision which is available from our website.

 

Regarding your questions – Nevron Chart for .NET provides support for Windows Forms and Web Forms. There is no separate gauge control in the VS Toolbox. The Gauge is available as part of Nevron Chart for .NET, in order to create a simple gauge you can follow these steps:

 

1.       Drop the NChartControl control to a form.

2.       Go to the form source code and insert:

 

using Nevron.Chart;

using Nevron.GraphicsCore;

 

at the top list of imported namespaces.

 

3.       In the form load insert the following code:

 

private void Form1_Load(object sender, EventArgs e)

{

    nChartControl1.Panels.Clear();

 

    // add a radial gauge to the chart

    NRadialGaugePanel radialGauge = new NRadialGaugePanel();

    nChartControl1.Panels.Add(radialGauge);

 

    // add a need indicator

    NNeedleValueIndicator needleIndicator = new NNeedleValueIndicator();

    radialGauge.Indicators.Add(needleIndicator);

    needleIndicator.Value = 50;

}

 

This creates a simple radial gauge from 0 to 100 and a needle indicator pointing at 50.

 

Then you can start adding embellishments – adding the following code will produce a much better looking gauge:

 

// configure begin and sweep angle

radialGauge.SweepAngle = 270;

radialGauge.BeginAngle = -225;

 

// add a need indicator

NNeedleValueIndicator needleIndicator = new NNeedleValueIndicator();

radialGauge.Indicators.Add(needleIndicator);

needleIndicator.Value = 50;

 

// configure begin and sweep angle

radialGauge.SweepAngle = 270;

radialGauge.BeginAngle = -225;

 

// configure the scale

NGaugeAxis axis = (NGaugeAxis)radialGauge.Axes[0];

NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator;

scale.SetPredefinedScaleStyle(PredefinedScaleStyle.Watch);

scale.SetPredefinedScaleStyle(PredefinedScaleStyle.PresentationNoStroke);

scale.MinorTickCount = 3;

scale.RulerStyle.FillStyle = new NColorFillStyle(Color.FromArgb(40, Color.White));

scale.OuterMajorTickStyle.FillStyle = new NColorFillStyle(Color.Orange);

scale.LabelStyle.TextStyle.FontStyle = new NFontStyle("Arial", 12, FontStyle.Bold);

scale.LabelStyle.TextStyle.FillStyle = new NColorFillStyle(Color.White);

 

// set rounded border

radialGauge.BorderStyle = new NEdgeBorderStyle(BorderShape.Auto);

 

// set some background

NAdvancedGradientFillStyle advGradient = new NAdvancedGradientFillStyle();

advGradient.BackgroundColor = Color.Black;

advGradient.Points.Add(new NAdvancedGradientPoint(Color.White, 10, 10, 0, 100, AGPointShape.Circle));

radialGauge.BackgroundFillStyle = advGradient;

 

Hopefully this helps – let us know if you have any questions or meet any problems.

 

Kind regards,

Nevron Support Team



Best Regards,
Nevron Support Team



moh aziz
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 4, Visits: 1

hi  thanks for helping.

As i really want to create a web application, i downloaded the latest version of nevron .net charting 2010 from what you had advised. but again all the controls are in the forms app and not in web app. In the web app underneath toolbars i can only see NChartControl and NDrawingView. When i try to add the above control to the web page it gives an error: "Operation could not be completed." why is this?



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

Hello,

 

For Web Applications or Web pages you need to drop NChartControl from the Toolbox. For Web Applications you need to manually add references to the Nevron assemblies, for Web page project you need to copy the required DLLs and add them in the project bin folder. For the gauge sample, make sure to add the following references:

Nevron.Chart.dll

Nevron.Chart.WebForm.dll

Nevron.Presentation.dll

Nevron.System.dll

Nevron.UI.WebForm.Controls.dll

 

Then used the code in the page related .cs file.

using Nevron.Chart;

using Nevron.GraphicsCore;

using System.Drawing;

 

Hopefully this helps.



Best Regards,
Nevron Support Team



moh aziz
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 4, Visits: 1

ok thankyou. now i can add a chart to the web page. so here is my real question:

like i mentioned before i want use ajax with the guage so it updates every few secs. im using sql db. so far i have the following code:

.aspx page

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Untitled Page</title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:ScriptManager ID="scriptManager" runat="server">

</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

<ncwc:NChartControl ID="NChartControl1" runat="server" Height="498px"

Width="630px">

</ncwc:NChartControl>

<asp:Timer ID="Timer1" runat="server">

</asp:Timer>

</ContentTemplate>

</asp:UpdatePanel>

</div>

</form>

</body>

</html>

 code behind file .cs

protected void Page_Load(object sender, EventArgs e)

{

// add a radial gauge to the chart

NRadialGaugePanel m_RadialGauge = new NRadialGaugePanel();

m_RadialGauge.PaintEffect = new NGlassEffectStyle();

m_RadialGauge.BorderStyle = new NEdgeBorderStyle(BorderShape.Auto);

m_RadialGauge.ContentAlignment = ContentAlignment.MiddleCenter;

m_RadialGauge.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(55, NRelativeUnit.ParentPercentage));

m_RadialGauge.Size = new NSizeL(new NLength(80, NRelativeUnit.ParentPercentage), new NLength(80, NRelativeUnit.ParentPercentage));

m_RadialGauge.BackgroundFillStyle = new NGradientFillStyle(Color.DarkGray, Color.Black);

NChartControl1.Panels.Add(m_RadialGauge);

// configure scale

NGaugeAxis axis = (NGaugeAxis)m_RadialGauge.Axes[0];

NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator;

scale.SetPredefinedScaleStyle(PredefinedScaleStyle.Presentation);

scale.LabelStyle.TextStyle.FontStyle = new NFontStyle("Arial", 12, FontStyle.Bold);

scale.LabelStyle.TextStyle.FillStyle = new NColorFillStyle(Color.White);

scale.LabelStyle.Angle = new NScaleLabelAngle(ScaleLabelAngleMode.Scale, 90);

scale.MinorTickCount = 4;

scale.RulerStyle.BorderStyle.Width = new NLength(0);

scale.RulerStyle.FillStyle = new NColorFillStyle(Color.DarkGray);

// add radial gauge indicators

NRangeIndicator m_Indicator1 = new NRangeIndicator();

m_Indicator1.Value = 20;

m_Indicator1.FillStyle = new NGradientFillStyle(Color.Yellow, Color.Red);

m_Indicator1.StrokeStyle.Color = Color.DarkBlue;

m_Indicator1.EndWidth = new NLength(-20);

m_RadialGauge.Indicators.Add(m_Indicator1);

NNeedleValueIndicator m_Indicator2 = new NNeedleValueIndicator();

m_Indicator2.Value = 79;

m_Indicator2.Shape.FillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.White, Color.Red);

m_Indicator2.Shape.StrokeStyle.Color = Color.Red;

m_RadialGauge.Indicators.Add(m_Indicator2);

m_RadialGauge.SweepAngle = 270;

// create and configure a numeric display attached to the radial gauge

NNumericDisplayPanel m_NumericDisplay = new NNumericDisplayPanel();

m_NumericDisplay.Location = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(70, NRelativeUnit.ParentPercentage));

m_NumericDisplay.ContentAlignment = ContentAlignment.TopCenter;

m_NumericDisplay.SegmentWidth = new NLength(2, NGraphicsUnit.Point);

m_NumericDisplay.SegmentGap = new NLength(1, NGraphicsUnit.Point);

m_NumericDisplay.CellSize = new NSizeL(new NLength(15, NGraphicsUnit.Point), new NLength(30, NGraphicsUnit.Point));

m_NumericDisplay.DecimalCellSize = new NSizeL(new NLength(10, NGraphicsUnit.Point), new NLength(20, NGraphicsUnit.Point));

m_NumericDisplay.ShowDecimalSeparator = false;

m_NumericDisplay.CellAlignment = VertAlign.Top;

m_NumericDisplay.BackgroundFillStyle = new NColorFillStyle(Color.DimGray);

m_NumericDisplay.LitFillStyle = new NGradientFillStyle(Color.Lime, Color.Green);

m_NumericDisplay.CellCountMode = DisplayCellCountMode.Fixed;

m_NumericDisplay.CellCount = 6;

m_NumericDisplay.Padding = new NMarginsL(6, 3, 6, 3);

m_RadialGauge.ChildPanels.Add(m_NumericDisplay);

// create a sunken border around the display

NEdgeBorderStyle borderStyle = new NEdgeBorderStyle(BorderShape.RoundedRect);

borderStyle.OuterBevelWidth = new NLength(0);

borderStyle.MiddleBevelWidth = new NLength(0);

m_NumericDisplay.BorderStyle = borderStyle;

}

so please can you advise how to update the guage with live data from db.



bob milanov
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

Group: Forum Members
Last Active: 6 Months Ago
Posts: 153, Visits: 11

Hi Moh,

Generally you need to connect to a db and execute an SQL statement fetching some data. You can take a look at the:

All Examples\Data Manipulation\Importing\From OleDbDataReader

example that shows how to achieve that. You can also take a look at MSDN:

http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdatareader(VS.71).aspx

Hope this helps - let me know if you meet any problems.

Best regards,
Bob





Similar Topics


Reading This Topic