Пример #1
0
    void Awake()
    {
        mGraph = gameObject.GetComponent <NGraph>();
        if (mGraph == null)
        {
            Debug.LogWarning("NGraph component not found.  Aborting.");
            return;
        }
        mGraph.setRanges(-10, 10, -8, 8);

        List <Vector2> data = new List <Vector2>();

        data.Add(new Vector2(-10, -3));
        data.Add(new Vector2(-8, 6));
        data.Add(new Vector2(-6, 2));
        data.Add(new Vector2(-4, -1));
        data.Add(new Vector2(-3, -7));
        data.Add(new Vector2(-2, -4));
        data.Add(new Vector2(-0, 3));

        mSeries1               = mGraph.addDataSeries <NGraphDataSeriesXy>("Simple Plot 1", Color.green);
        mSeries1.PlotStyle     = NGraphDataSeriesXy.Style.Line;
        mSeries1.PlotThickness = 3f;
        mSeries1.Data          = data;

        mSeries1               = mGraph.addDataSeries <NGraphDataSeriesXy>("Simple Plot 2", Color.red);
        mSeries1.PlotStyle     = NGraphDataSeriesXy.Style.Bar;
        mSeries1.PlotThickness = 10f;
        mSeries1.Data          = data;
    }
Пример #2
0
    public void createPlot2()
    {
        captureGraph();
        mSeries2 = mGraph.addDataSeries <NGraphDataSeriesXy>("2", Color.red);
        mSeries2.PlotThickness = Plot1ThicknessSlider.value;
        mSeries2.MarkerWeight  = Plot1MarkerWeightSlider.value;
        mSeries2.Reveal        = Plot2RevealTimeSlider.value;
        Plot2PlotStlyeChange();
        Plot2MarkerStlyeChange();

        // Apply our data to the plot.
        mSeries2.Data = data2;
    }
Пример #3
0
    public void createPlot1()
    {
        captureGraph();
        mSeries1 = mGraph.addDataSeries <NGraphDataSeriesXy>("1", Color.blue);
        mSeries1.PlotThickness = Plot1ThicknessSlider.value;
        mSeries1.MarkerWeight  = Plot1MarkerWeightSlider.value;
        mSeries1.Reveal        = Plot1RevealTimeSlider.value;
        Plot1PlotStlyeChange();
        Plot1MarkerStlyeChange();

        // Apply our data to the plot.
        mSeries1.Data = data1;
    }
Пример #4
0
    public void ShowPlot2()
    {
        // Do not try to create run-time objects unless we are in play mode
        if (!Application.isPlaying)
        {
            return;
        }

        captureGraph();
        if (mSeries2 != null)
        {
            mGraph.removeDataSeries(mSeries2);
            mSeries2 = null;
        }
        else
        {
            createPlot2();
        }
    }