Giter VIP home page Giter VIP logo

scichart.wpf.examples's Introduction

SciChart WPF Demo, Examples, Tutorials and Boilerplates

What's in this repo?

  1. Examples Source code for SciChart.WPF: High Performance Realtime WPF Chart Library found under the /Examples folder
  2. Source code for tutorials for SciChart WPF, found under the /Tutorials folder
  3. Sandbox examples, including a [/Sandbox/LicensingTestApp](Licensing Test App) plus several useful examples found under the /Sandbox folder

   
Scroll down for Build Instructions!
   

Using the SciChart.Wpf.Examples Repository

The SciChart WPF Examples Suite has over 130 examples of 2D & 3D WPF Charts with & without MVVM, as well as featured apps which show the speed, power and flexibility of the SciChart.WPF Chart library!

Browse SciChart WPF examples, search by keyword, code or description, view source-code and export examples to stand-alone Visual Studio solutions.

SciChart WPF Examples - WPF Chart library

Build Instructions

To compile the Examples App, you will need:

  • To start a SciChart WPF Trial find out how or purchase a license.

    • Although the examples app will work without a trial license, modifying or creating your own examples won't
  • To setup the NuGet package source before you can compile. Here's How

    1. After cloning the repo, open SciChart2D3D.Examples.sln found in the /Examples folder in Visual Studio.

    2. Setup the Nuget Package source. While SciChart is hosted on Nuget.org, Hotfix builds (required for this examples app repo) are hosted at MyGet.

      Nuget Feed Setup

  • Once you've done that, compile and run the app as usual
         

WPF 2D Chart Types

SciChart WPF Includes the following 2D & 3D chart types, as well as an wide set of features, excellent performance and a poweful, flexible API.

WPF 3D Chart Types

SciChart WPF also has an array of DirectX-powered Realtime 3D Charts for WPF, including:

SciChart WPF Comes with a number of tutorials to help you get started quickly using our powerful & flexible chart library! Please see below:

SciChart WPF Tutorials

Source code for the tutorials is found under the /Tutorials folder

A place to put ideas, examples for users to answer support requests and more.

... And Finally!

License

SciChart WPF is commercial software with a free 30-day trial. Built by a dedicated team of developers, were an independent business which strives to do the best for our users!

Anything in this Repository is covered by MIT license - meaning you can freely use our example/demo/tutorial code in your applications.

SciChart WPF Licensing Links

 

Useful links

We've prepared a short Getting Started guide for SciChart WPF here.

This will walk you through the entire process of getting started and show you where tutorials and documentation are and examples.

Other useful links below:

scichart.wpf.examples's People

Contributors

andyb1979 avatar bdemien avatar coderlex avatar joerirg avatar nathan0dev avatar scichartteam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scichart.wpf.examples's Issues

Mvvm Annotation example Invalid Operation Exception crash just by changing the Annotation Canvas

Hello,

I used your example of Mvvm annotations.
I adapted the version to suit my runtime on the pc (it also happens for newest with .NET core).
I changed the AnnotationCanvas like so bug branch AnnotationCanvas = Charting.Visuals.Annotations.AnnotationCanvas.BelowChart.
The outcome is it complains with an exception about a circular reference.

I did not find documentation regarding the proper way of setup this scenario.
Why does this happen and how to properly resolve this issue?
We would like to leave it "in place" of assignment so in this case inside the Window.

In our scenario we need custom subclass of Axis Marker and some customized annotations.

Cyclic reference found while evaluating the Style property on element 'SciChart.Mvvm.Tutorial.InfoAnnotation'.

sciChartStackTrace.txt

[UPDATE]

I removed the downgrade of .NET runtime so the example uses latest SciChart (currently 7.0.1.27055) with .NET 4.6.2.

why Box Annotation move

I used box annotation like pic
in a boxAnnotation I used

.withIsEditable(true)
.withPosition(1,-2, 0, 2)
.withBackgroundDrawableId(R.drawable.example_box_annotation_background_4)
.withResizingGrip(customIResizingGrip)
.withAnnotationDragListener(customIAnnotationSelectionDrawable)
.withResizeDirections(Direction2D.XDirection)
.withDragDirections(Direction2D.XDirection)
.build();

and i made a 2 box like pic

i use box for drag one side to make a box big or small

the first box which is left doesn’t move anywhere.
it just can only drag that i want
but the second box, the box moves when i drag after first touch
the left box never moves on but right box moves first drags
just move sometimes

//******************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2017. All rights reserved.
//
// Web: http://www.scichart.com
// Support: [email protected]
// Sales: [email protected]
//
// AnnotationsAreEasyFragment.java is part of the SCICHART® Examples. Permission is hereby granted
// to modify, create derivative works, distribute and publish any part of this source
// code whether for commercial, private or personal use.
//
// The SCICHART® examples are distributed in the hope that they will be useful, but
// without any warranty. It is provided "AS IS" without warranty of any kind, either
// expressed or implied.
//******************************************************************************

package com.scichart.examples.fragments;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

import com.scichart.charting.Direction2D;
import com.scichart.charting.visuals.SciChartSurface;
import com.scichart.charting.visuals.annotations.BoxAnnotation;
import com.scichart.charting.visuals.annotations.HorizontalAnchorPoint;
import com.scichart.charting.visuals.annotations.IAnnotation;
import com.scichart.charting.visuals.annotations.IResizingGrip;
import com.scichart.charting.visuals.annotations.OnAnnotationDragListener;
import com.scichart.charting.visuals.annotations.VerticalAnchorPoint;
import com.scichart.charting.visuals.axes.IAxis;
import com.scichart.core.framework.UpdateSuspender;
import com.scichart.examples.R;
import com.scichart.examples.fragments.base.ExampleBaseFragment;

import java.util.Collections;

import butterknife.BindView;

public class AnnotationsAreEasyFragment extends ExampleBaseFragment {
@BindView(R.id.chart)
SciChartSurface surface;

@Override
public boolean showDefaultModifiersInToolbar() {
    return false;
}

@Override
protected int getLayoutId() {
    return R.layout.example_single_chart_fragment;
}

@Override
protected void initExample() {
    Paint paint = new Paint();
    paint.setColor(Color.RED);

    Canvas canvas = new Canvas();
    canvas.drawRect(100, 100, 100, 100, paint);

    CustomIResizingGrip customIResizingGrip = new CustomIResizingGrip();
    CustomLeftBoxAnnotationDragListener customLeftBoxAnnotationDragListener = new CustomLeftBoxAnnotationDragListener();
    CustomRightBoxAnnotationDragListener customRightBoxAnnotationDragListener = new CustomRightBoxAnnotationDragListener();

    customIResizingGrip.onDraw(canvas, 10, 20);

    final BoxAnnotation boxAnnotation = sciChartBuilder.newBoxAnnotation()
            .withIsEditable(true)
            .withPosition(7d, 2d, 9d, 4d)
            .withBackgroundDrawableId(R.drawable.example_box_annotation_background_4)
            .withResizingGrip(customIResizingGrip)
            .withAnnotationDragListener(customLeftBoxAnnotationDragListener)
            .withDragDirections(Direction2D.XDirection)
            .withResizeDirections(Direction2D.XDirection)
            .build();

    final BoxAnnotation boxAnnotation2 = sciChartBuilder.newBoxAnnotation()
            .withIsEditable(true)
            .withPosition(4d,4d, 2d,2d)
            .withBackgroundDrawableId(R.drawable.example_box_annotation_background_4)
            .withResizingGrip(customIResizingGrip)
            .withAnnotationDragListener(customRightBoxAnnotationDragListener)
            .withDragDirections(Direction2D.XDirection)
            .withResizeDirections(Direction2D.XDirection)
            .build();

    UpdateSuspender.using(surface, new Runnable() {
        @Override
        public void run() {
            final IAxis xAxis = sciChartBuilder.newNumericAxis()
                    .withVisibleRange(0d, 10d)
                    .withGrowBy(0.1d, 0.1d)
                    .withTextFormatting("0.0#")
                    .build();

            final IAxis yAxis = sciChartBuilder.newNumericAxis()
                    .withVisibleRange(0d, 10d)
                    .withGrowBy(0.1d, 0.1d)
                    .withTextFormatting("0.0#")
                    .build();

            Collections.addAll(surface.getXAxes(), xAxis);
            Collections.addAll(surface.getYAxes(), yAxis);
            Collections.addAll(surface.getAnnotations(), boxAnnotation, boxAnnotation2);
            Collections.addAll(surface.getAnnotations(),
                    sciChartBuilder.newTextAnnotation()
                            .withX1(5d)
                            .withY1(8d)
                            .withHorizontalAnchorPoint(HorizontalAnchorPoint.Center)
                            .withVerticalAnchorPoint(VerticalAnchorPoint.Bottom)
                            .withText("Anchor Center (X1, Y1)")
                            .build(),
                    sciChartBuilder.newTextAnnotation()
                            .withX1(5d)
                            .withY1(8d)
                            .withHorizontalAnchorPoint(HorizontalAnchorPoint.Right)
                            .withVerticalAnchorPoint(VerticalAnchorPoint.Top)
                            .withText("Anchor Right")
                            .build(),
                    sciChartBuilder.newTextAnnotation()
                            .withX1(5d)
                            .withY1(8d)
                            .withHorizontalAnchorPoint(HorizontalAnchorPoint.Left)
                            .withVerticalAnchorPoint(VerticalAnchorPoint.Top)
                            .withText("or Anchor Left")
                            .build());

            surface.getChartModifiers().add(sciChartBuilder.newModifierGroupWithDefaultModifiers().build());
        }
    });
}

public static class CustomView1 extends View {

    private final int FILL_COLOR = Color.parseColor("#571CB61C");
    private final int STROKE_COLOR = Color.parseColor("#FF00B400");

    private final Path path = new Path();
    private final Paint paintFill = new Paint();
    private final Paint paintStroke = new Paint();

    public CustomView1(Context context) {
        super(context);
        init();
    }

    public CustomView1(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    private void init() {
        paintFill.setStyle(Paint.Style.FILL);
        paintFill.setColor(FILL_COLOR);
        paintStroke.setStyle(Paint.Style.STROKE);
        paintStroke.setColor(STROKE_COLOR);

        path.moveTo(0, 15);
        path.lineTo(15, 0);
        path.lineTo(30, 15);
        path.lineTo(20, 15);
        path.lineTo(20, 30);
        path.lineTo(10, 30);
        path.lineTo(10, 15);
        path.lineTo(0, 15);

        setMinimumHeight(50);
        setMinimumWidth(50);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawPath(path, paintFill);
        canvas.drawPath(path, paintStroke);
    }

}

public static class CustomView2 extends View {

    private final int FILL_COLOR = Color.parseColor("#57B22020");
    private final int STROKE_COLOR = Color.parseColor("#FF990000");

    private final Path path = new Path();
    private final Paint paintFill = new Paint();
    private final Paint paintStroke = new Paint();

    public CustomView2(Context context) {
        super(context);
        paintFill.setStyle(Paint.Style.FILL);
        paintFill.setColor(FILL_COLOR);
        paintStroke.setStyle(Paint.Style.STROKE);
        paintStroke.setColor(STROKE_COLOR);

        path.moveTo(0, 15);
        path.lineTo(10, 15);
        path.lineTo(10, 0);
        path.lineTo(20, 0);
        path.lineTo(20, 15);
        path.lineTo(30, 15);
        path.lineTo(15, 30);
        path.lineTo(0, 15);

        setMinimumHeight(50);
        setMinimumWidth(50);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawPath(path, paintFill);
        canvas.drawPath(path, paintStroke);
    }

}

public static class CustomLeftBoxAnnotationDragListener implements OnAnnotationDragListener {
    @Override
    public void onDragStarted(IAnnotation iAnnotation) {
    }

    @Override
    public void onDragEnded(IAnnotation iAnnotation) {
        iAnnotation.setSelected(false);
        Log.i("Left", String.valueOf(iAnnotation.getX1()));
    }

    @Override
    public void onDragDelta(IAnnotation iAnnotation, float v, float v1) {
    }
}

public static class CustomRightBoxAnnotationDragListener implements OnAnnotationDragListener {

    @Override
    public void onDragStarted(IAnnotation iAnnotation) {

    }

    @Override
    public void onDragEnded(IAnnotation iAnnotation) {
        iAnnotation.setSelected(false);
        Log.i("Right", String.valueOf(iAnnotation.getX1()));
    }

    @Override
    public void onDragDelta(IAnnotation iAnnotation, float v, float v1) {

    }
}

public static class CustomIResizingGrip implements IResizingGrip {
    @Override
    public void onDraw(Canvas canvas, float v, float v1) {
    }

    @Override
    public boolean isHit(float v, float v1, float v2, float v3) {
        return true;
    }
}

}

제목 없음

Exception when using SciChartInteractionToolbar and Binding to YAxes/XAxes

An exception is thrown from this line when using binding on either the XAxes or YAxes properties of the ChartSurface.

This can be seen by uncommenting this line in the example "Axis Binding and Annotations Binding".

One way this can be resolved by changing the line to something like this...
var isPolar = surface != null && (surface.IsPolarChart || (surface.XAxes?.Any(x => x.IsPolarAxis) ?? false) || (surface.YAxes?.Any(x => x.IsPolarAxis) ?? false));

And probably adding something like this to the end of OnTargetSurfaceDependencyPropertyChanged...
scs.XAxesCollectionNewCollectionAssigned += (_, __) => toolbar.OnCreateModifiers(toolbar, scs); scs.XAxesCollectionNewCollectionAssigned += (_, __) => toolbar.OnCreateModifiers(toolbar, scs);

FastColumnRenderableSeries with the same DataPointWidth will rendered using different width

   `var ran = new Random();
        for (int t = 0; t < 5; t++)
        {
            var dataSeries = new XyDataSeries<double, double>();
            for (int i = 95; i < 100; i++)
                dataSeries.Append(i+ran.NextDouble(), ran.Next(100));

            var columnSeries = new FastColumnRenderableSeries()
            {
                Stroke = Colors.White,
                Fill = new SolidColorBrush(Color.FromArgb(0x33, 0xFF, 0x66, 0x00)),
                StrokeThickness = 2,
                DataPointWidth = 0.1,
                UseUniformWidth = false,
                AntiAliasing = true,
                ZeroLineY = 0.0,
            };
            sciChartSurface.RenderableSeries.Add(columnSeries);
            columnSeries.DataSeries = dataSeries;
        }


        for (int i = 0; i < sciChartSurface.RenderableSeries.Count; i++)
        {
            Console.WriteLine((sciChartSurface.RenderableSeries[i] as FastColumnRenderableSeries).DataPointWidth); 
        }`

1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.