Eto , Windows chart or oxyplot?

Yes i did

import clr

but i think the method is complicated or something wrong, for example when i use this
i got this error

Runtime error (ArgumentOutOfRangeException): Specified argument was out of the range of valid values.
Parameter name: Type for 'Eto.OxyPlot.Plot' could not be found in this platform

  line 13, in script

I will try to find a way to make windows chart work with eto form, i don’t think oxyplot work with ironpython

IronPython is just C# with Python syntax. Again, you can try to directly use WPF. That definitely works. I think its just that you are missing some reference. Do you see any dll I mentioned? They are about 600kb in total

The dll’s created with Visual studio, i added Eto.Form, and Eto.oxyplot and Eto.oxyplot.wpf to the project than i copied them all to Rhino folder.

This created with windows form, but Eto looks better and many examples and tutorials available in Rhino website, also windows form loaded very slowly when i open the gh file.

I was looking at the Github repro. Maybe you should try: just Eto.OxyPlot.Plot() to initialize. It seems it will automatically initialize the view.
I found this Oxyplot for Eto.Mac · Issue #3 · LorenVS/Eto.OxyPlot · GitHub

But they also said, Mac is not supported. Which makes it pointless to use this Eto wrapper within the Rhino environment…

As i mentioned before Eto.OxyPlot.Plot() give an error , that why i think maybe it can’t work with Ghpython

Yeah maybe I show you later on how to do this with WPF/C# in Rhino. Should be easy. Don’t have access to Rhino currently

Thank you , i use python , c# is very complicated
I tried to design windows form in visual studio and than use the code with Ghpython , i hope Rhino developers add a tool to create design forms like in visual studio

Ok here it is:

This is how you run a Wpf window with Python

import clr

basePath = "c:\\path\\to\\your\\lib\\folder\\"

clr.AddReferenceToFileAndPath(basePath + "OxyPlot.dll")
clr.AddReferenceToFileAndPath(basePath + "OxyPlot.Wpf.dll")
clr.AddReferenceToFileAndPath(basePath + "OxyPlotExample.exe")

from OxyPlotExample import MainWindow
import System.Windows as sw
import Rhino
import OxyPlot as oxy
import System
from System.Collections.Generic import List

exWnd = MainWindow(); 
# Populate with example points

# Create a series from Rhino and pass it over
list = List[oxy.DataPoint]()


In Visual Studio create a WPF Application targeting Net Framework 4.5 (not Core!!!).
Get the nuget package OxyPlot.Wpf (downloads OxyPlot.Core).

Modify the MainWindow.xaml

<Window x:Class="OxyPlotExample.MainWindow"
        Title="Oxy Plot Example" Height="450" Width="800">
        <oxy:PlotView x:Name="_plotView"></oxy:PlotView>

And in the codebehind MainWindow.cs

using OxyPlot;
using OxyPlot.Axes;
using OxyPlot.Series;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace OxyPlotExample
    /// <summary>
    /// Interaktionslogik für MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
        private PlotModel _model;

        public MainWindow()
        /// <summary>
        /// Initializes Oxyplot (Non-MVVM)
        /// </summary>
        private void InitOxy()
            _model = new OxyPlot.PlotModel();
            _model.Axes.Add(new LinearAxis() { Title = "X", Minimum = 0.0, Maximum = 10.0 });
            _model.Axes.Add(new LinearAxis() { Title = "Y", Minimum = 0.0, Maximum = 10.0 });              
            _plotView.Model = _model;

        public void Draw(IEnumerable<DataPoint> points)
            var series = new LineSeries(); // cache it if frequently changed
            _model.InvalidatePlot(true); // Redraw

        public void DrawExample(int n)
            DataPoint[] points = new DataPoint[n];
            Random rnd = new Random(42);
            for (int i = 0; i < n; i++)
                points[i] = new DataPoint(i*0.1, rnd.NextDouble() * 10);



And compile… Don’t forget to reference the path to these files in the Python script.
If you don’t want to do the VS part, take the following example compilation: (382.0 KB)


Thank you very much Tom, excellent work
I will check it