当使用qwtplotbarchart来使用柱状图时。可以通过下面代码来设置柱状图的颜色

    QwtPlotBarChart  *barChart = new QwtPlotBarChart("Bar Chart" );
    QwtColumnSymbol *symbol = new QwtColumnSymbol( QwtColumnSymbol::Box );
    symbol->setLineWidth( 2 );
    symbol->setFrameStyle( QwtColumnSymbol::Raised );
    QColor c(QColor::fromRgb(49,109,165));
    symbol->setPalette(c);
    barChart->setSymbol(symbol);

通过setSymbol就可以设置每条柱状图的颜色

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2022-02-26
  • 2022-12-23
猜你喜欢
  • 2021-09-30
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2022-03-09
  • 2021-12-25
  • 2021-09-04
相关资源
相似解决方案