QtCharts:给QChartView换肤,换背景色添加背景图片

QChart背景设置

换色

setBackgroundBrush这种接口可以设置QChartView 背景色

首先,给QChart类去掉背景渲染:

换肤

QChart *chart = new QChart();
chart->setTheme(QChart::ChartThemeLight);

这里chart是你自检的chart 进入枚举一共有多个,可以自己看下,那个更适合。

换背景

下面展示一些 内联代码片

chart->setBackgroundVisible(false);  //去背景
chart->setStyleSheet(" background-image:url(:/1.png);");

猜你喜欢

转载自blog.csdn.net/amxld/article/details/112712428
今日推荐