Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            double[] x = new double[] { 1, 2 };
            double[] y = new double[] { 5, 10 };

            LinearAxis xAxis = new LinearAxis();

            xAxis.SetValue("title", "xAxis");
            xAxis.SetValue("showgrid", false);
            xAxis.SetValue("showline", true);

            LinearAxis yAxis = new LinearAxis();

            yAxis.SetValue("title", "yAxis");
            yAxis.SetValue("showgrid", false);
            yAxis.SetValue("showline", true);

            Layout layout = new Layout();

            layout.SetValue("xaxis", xAxis);
            layout.SetValue("yaxis", yAxis);
            layout.SetValue("showlegend", true);

            Trace trace = new Trace("scatter");

            trace.SetValue("x", x);
            trace.SetValue("y", y);
            trace.SetValue("mode", "markers");
            trace.SetValue("name", "Hello from C#");

            GenericChart
            .ofTraceObject(true, trace)
            .WithLayout(layout)
            .Show();
        }
Ejemplo n.º 2
0
        public void OptionalArgumentsAndDynamicSettingAreEqual()
        {
            var actual = LinearAxis.init <IConvertible, IConvertible, IConvertible, IConvertible, IConvertible, IConvertible>(Color: Color.fromString("red"), AxisType: StyleParam.AxisType.Linear);

            var expected = new LinearAxis();

            expected.SetValue("color", Color.fromString("red"));
            expected.SetValue("type", StyleParam.AxisType.Linear.Convert());

            Assert.Equal(expected.GetProperties(true), actual.GetProperties(true));
        }