Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: Graphical Report  (Read 5231 times)

arvind.k@propixtech.com

  • Newbie
  • *
  • Posts: 3
    • View Profile
Graphical Report
« on: July 31, 2018, 03:53:22 pm »
I want to show some data on bar-graph.
Does any graphical template/tool available in lime report ?

Subst

  • Sr. Member
  • ****
  • Posts: 450
    • View Profile
Re: Graphical Report
« Reply #1 on: July 31, 2018, 05:26:36 pm »
develop branch contains charts

Another way - create the graph inside your Qt code and export in report

cwl

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Graphical Report
« Reply #2 on: November 19, 2018, 11:45:20 am »
Hi,how to export a QCahrtView to the report ,thank u very much

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1005
    • View Profile
Re: Graphical Report
« Reply #3 on: November 20, 2018, 09:41:12 pm »
cwl Hi!
In the callback data source you can realize something like this:

Copyright by Subst :)
Code: [Select]
if (tab<m_tabBar->count())
    {
    QChart *chart=m_groupChartHash[m_tabGroupHash[tab]];
    QPixmap pixmap(chart->size().toSize());
    QPainter painter;
    QByteArray data;
    QBuffer buffer(&data);
    buffer.open(QIODevice::WriteOnly);
    painter.begin(&pixmap);
    chartView->render(&painter);
    painter.end();

    pixmap.save(&buffer,"PNG");
    buffer.close();
    value=data;
    }
   else
    value=QVariant();
   break;
   }

cwl

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Graphical Report
« Reply #4 on: November 22, 2018, 10:41:41 am »
thank you alex:
i know how to insert a image to the report by using the call back method, the question is the image will distortion when zoom in. so is there any method to solve this problem.

cwl

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Graphical Report
« Reply #5 on: November 22, 2018, 12:19:43 pm »
Is there any method like this,the chart on pdf is never distortion  when  zoom in anyhow.
        vfchartView->setRenderHint(QPainter::TextAntialiasing);
   vfchartView->show();
        QPdfWriter writer("chart.pdf");
   writer.setPageSize(QPagedPaintDevice::A4);
   QPainter painter(&writer);
   QRect chartRect = vfchartView->viewport()->rect();
   QRect pdfRect = QRect(500, 500, 5000, 5000);
        vfchartView->render(&painter, pdfRect, chartRect,Qt::KeepAspectRatio);

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1005
    • View Profile
Re: Graphical Report
« Reply #6 on: November 22, 2018, 03:33:31 pm »
To draw a diagram without distortion is needed qchart item's wrapper. I'll think about it.

cwl

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Graphical Report
« Reply #7 on: November 23, 2018, 09:54:38 am »
Alex , thank you ! Looking forward to your solution.

cwl

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Graphical Report
« Reply #8 on: November 26, 2018, 04:05:44 am »
Hi Alex, could current version solve the problem. thank u!