qt qchart柱状图坐标轴设置问题

weixin_38048154 2019-09-19 01:00:25
如何将红圈内的空间缩小,甚至没有描述:所有两侧的空间想缩小      QBarSet *set0 = new QBarSet("");   QBarSet *set1 = new QBarSet("");   QBarSet *set2 = new QBarSet("");    QBarSet *set3 = new QBarSet("");    QBarSet *set4 = new QBarSet("");    QBarSet *set5 = new QBarSet("");    QBarSet *set6 = new QBarSet("");   QBarSet *set7 = new QBarSet("");    QBarSet *set8 = new QBarSet("");    QBarSet *set9 = new QBarSet("");   QBarSet *set10 = new QBarSet("");    QBarSet *set11 = new QBarSet("");   QBarSet *set12 = new QBarSet("");    QBarSet *set13 = new QBarSet("");    QBarSet *set14 = new QBarSet("");    QBarSet *set15 = new QBarSet("");    QBarSet *set16 = new QBarSet("");   QBarSet *set17 = new QBarSet("");   QBarSet *set18 = new QBarSet("");    QBarSet *set19 = new QBarSet("");    QBarSet *set20 = new QBarSet("");   QBarSet *set21 = new QBarSet("");    QBarSet *set22 = new QBarSet("");    QBarSet *set23 = new QBarSet("");    QBarSet *set24 = new QBarSet("");    QBarSet *set25 = new QBarSet("");    QBarSet *set26 = new QBarSet("");    QBarSet *set27 = new QBarSet("");     *set0 << 1 ;    *set1 << 5 ;    *set2 << 3 ;    *set3 << 5 ;    *set4 << 9 ;    *set5 << 9 ;   *set6 << 9 ;   *set7 << 9 ;   *set8 << 9 ;   *set9 << 9 ;   *set10 << 9 ;   *set11 << 9 ;   *set12 << 9 ;    *set13 << 9 ;    *set14 << 1 ;    *set15 << 5 ;   *set16 << 3 ;    *set17 << 5 ;   *set18 << 9 ;    *set19 << 9 ;    *set20 << 9 ;   *set21 << 9 ;   *set22 << 9 ;    *set23 << 9 ;    *set24 << 9 ;   *set25 << 9 ;   *set26 << 9 ;   *set27 << 9 ;     QBarSeries *series = new QBarSeries();   series->append(set0);    series->append(set1);    series->append(set2);    series->append(set3);    series->append(set4);    series->append(set5);   series->append(set6);    series->append(set7);   series->append(set8);    series->append(set9);   series->append(set10);    series->append(set11);    series->append(set12);    series->append(set13);    series->append(set14);    series->append(set15);   series->append(set16);   series->append(set17);   series->append(set18);   series->append(set19);   series->append(set20);   series->append(set21);    series->append(set22);   series->append(set23);    series->append(set24);    series->append(set25);    series->append(set26);   series->append(set27);     QChart *chart = new QChart();    QChartView *chartView = new QChartView(chart);//    v.setRubberBand(QChartView::HorizontalRubberBand);    chartView->setRubberBand(QChartView::RectangleRubberBand);    chart->addSeries(series);    chart->setTitle("Simple barchart example");   chart->setAnimationOptions(QChart::SeriesAnimations);   chart->setTheme(QChart::ChartThemeBlueCerulean);    QStringList categories;    categories << "Jan" ;   QBarCategoryAxis *axis = new QBarCategoryAxis();    axis->append(categories);   axis->setGridLineVisible(false);    chart->createDefaultAxes();    chart->setAxisX(axis, series);    chart->legend()->setVisible(false);    chart->legend()->setAlignment(Qt::AlignBottom);//    QChartView *chartView = new QChartView(this);    ui->graphicsView->setChart(chart);   ui->graphicsView->setRubberBand(QChartView::RectangleRubberBand);    ui->graphicsView->setRenderHint(QPainter::Antialiasing);
...全文
1217 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38067167 2019-09-19
  • 打赏
  • 举报
回复
直接设置 Chart 控件的宽度 ?
weixin_38075965 2019-09-19
  • 打赏
  • 举报
回复
貌似去不了,没看到QChart有类似接口

464

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧