how to add series in run time into frxChartView

edited 6:45PM in FastReport 4.0
Hi,

I add series in run time and series count is also increased.
Finally there is a blank chart on report.
Is it possible to add series in run time into frxChartView on fast report?
Any help is highly appreciated.

void TFormMain::DisplayRptForceCurveChart(TfrxChartView *CtrlChart)
{
TFastLineSeries * series1;
series1 = new TFastLineSeries(this);
double dValue,dMax;

CtrlChart->Chart->AddSeries(series1);

if (iRptIndex >= 0)
{
qsData = (QSTATA_DATA *)OrdDataList->GetData(iRptIndex);
if (qsData)
{
top = qsData->TimeInterval.ToInt() / double(1000);

dMax = 0.0;

dValue = ValToAbsForce_2(qsData->PFSignature->Strings[0].ToInt(), (TForceUnit)fuN, fNCapacity, ADC_16_BITS, fFactor);
series1->AddXY(0,ConvertFUnit(dValue),"",(TColor)clTeeColor );

for (i=1; i<500; i++)
{
dValue = ValToAbsForce_2(qsData->PFSignature->Strings.ToInt(), (TForceUnit)fuN, fNCapacity, ADC_16_BITS, fFactor);
series1->AddXY(i*top,ConvertFUnit(dValue),"",(TColor)clTeeColor );

if (dValue > dMax)
dMax = dValue;

}
}
}

if (dTargetPF > dMax)
dMax = dTargetPF;

int m = dMax + dMax*0.05;

CtrlChart->Chart->LeftAxis->SetMinMax(0,m);
}

Best Regards,
Ni Ni

Comments

  • I recently got send the code block

    Something like:  
    <CODE>TLineSeries* s;
     TfrxChartView* Chart1;
     TfrxSeriesItem * SItem;
    
    
    	Chart1 = new TfrxChartView(band);
    	Chart1->SetBounds(1, 1, 500, 500);
    	Chart1->AddSeries(csLine);
    	s = (TLineSeries * )Chart1->Chart->Series[0];
    	SItem = Chart1->SeriesData->Items[0];
        SItem->DataType = dtFixedData;
    	SItem->Source1 = "1;2;3";
    	SItem->Source2 = "1;2;3";</CODE>
    

    when I asked a similar question, I am currently trying to figure out the print/view part, but I hope this helps you get started

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.