Pre loader

C# code to declare a SciChartSurface

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

i am tried to use this code in window.cs file …it is not showing any output. kindly let me know the steps what i have to do for getting output

// Create the chart surface
var sciChartSurface = new SciChartSurface();

// Create the X and Y Axis
var xAxis = new NumericAxis() { AxisTitle = "Number of Samples (per series)"};
var yAxis = new NumericAxis() { AxisTitle = "Value"};

sciChartSurface.XAxis = xAxis;
sciChartSurface.YAxis = yAxis;

// Specify Interactivity Modifiers
sciChartSurface.ChartModifier = new ModifierGroup(new RubberBandXyZoomModifier(), new ZoomExtentsModifier());
// Add annotation hints to the user
var textAnnotation = new TextAnnotation()
{
   Text = "Hello World!",
   X1=5.0,
   Y1=5.0
};
sciChartSurface.Annotations.Add(textAnnotation);
Version
v6.x
  • You must to post comments
0
0

I can’t see any problems in your code, if you’ve added the chart to a WPF Window or parent control it should draw.

I would suggest working through our tutorials on SciChart WPF. We have a set of tutorials which use just code-behind here:

WPF Chart Tutorials (Code Behind)

and a set of tutorials for MVVM here

WPF Chart Tutorials (MVVM)

This will give you an understanding of the SciChart APIs and how to do common features. After that if you are still stuck, feel free to ask questions.

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies