我有Ubuntu 14.04
,我正在使用QT
C ++
。我将画两条线(在QcustomPlot
)每条线的颜色不同。我将画一条红色线然后画一条绿色线, 像这样
我的代码:
customPlot->addGraph() ; // color red
customPlot->addGraph() ; // color green
customPlot->graph(0)->setPen(QPen(Qt::red));
customPlot->graph(1)->setPen(QPen(Qt::red));
customPlot->graph(1)->setPen(QPen(Qt::green);
customPlot->graphe(0)->adddata(1,1) ;
customPlot->graphe(0)->adddata(5,1) ;
customPlot->graphe(1)->adddata(5,1) ;
customPlot->graphe(1)->adddata(10,1) ;
customPlot->graphe(0)->adddata(10,1) ;
customPlot->graphe(0)->adddata(15,1) ;
问题是红线画在绿色上怎么解决?