Esempio n. 1
0
 private static void DrawCombinedTraces(IEnumerable <PlotView> plotViews)
 {
     foreach (var plotView in plotViews)
     {
         GenericChart.combine(plotView.Traces.Select(GetTrace))
         .WithLayout(Layout.init <object, object, object, object, object, object, object>(
                         plotView.PlotName,
                         null,
                         null,
                         null,
                         null,
                         1500,
                         600,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null,
                         null)).Show();
     }
 }
Esempio n. 2
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();
        }
Esempio n. 3
0
        public static string ToFullScreenHtml(this GenericChart.GenericChart chart)
        {
            var config = GenericChart.getConfig(chart);
            var layout = GenericChart.getLayout(chart);

            DynObj.setValueOpt <bool>(config, "responsive", true);
            DynObj.setValueOpt <double>(layout, "width", null);
            DynObj.setValueOpt <double>(layout, "height", null);
            return(GenericChart.toChartHTML(chart).Replace("width: 600px; height: 600px;", "width: 100%; height: 100%;"));
        }