ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Multiple Datasets with different amout of points
Posted by sinan on Mar-20-2018 02:51
Attachments:
Hi Peter,

I'm trying to reproduce a graph in ChartDirector like in the picture below.
My problem is to show the circles (or any other symbol) at the corresponding positions in the chart.

My data:

    Date [] timeStampsA;
    Double[] dataSeriesA;

    Date[] timeStampsB; ( signal-points - coloring by condition (negative/positive))
    Double[] dataSeriesB;

My Layer for the A-Series:

        LineLayer layer = c.addLineLayer2();
        layer.setLineWidth(1);
        layer.setFastLineMode();
        layer.setXData(viewPortTimeStampsA);
        layer.addDataSet(viewPortDataSeriesA, 0xccaa00, "Tick");

(with viewport-technique as in your splendit simplezoomscroll example)

How should I construct and layout the second layer??

Thank you in advance!

Sinan
demo.png

  Re: Multiple Datasets with different amout of points
Posted by sinan on Mar-20-2018 03:36
Hi Peter,

please ignore my question - I solved this already in 2011 :-)

// First prepare Data
    size_t count = vSignals.size();

    yData = new double[count];
    xData = new double[count];
    for(size_t i = 0; i < count; i++ )
    {
        std::pair<double, double>& p = vSignals[i];
        xData[i] = p.first;
        yData[i] = p.second;
    }

// And then create the layer

    ScatterLayer *scatter =
        c->addScatterLayer(DoubleArray(xData, (int)nCount),
                                         DoubleArray(yData, (int)nCount),
                                        "", Chart::CircleSymbol, 15, 0x60ff0000);

Seems a littlebit awkward to me, but it does the job.

Thank you!
Sinan