LimeReport Forum

General Category | Основное => Discussion | Обсуждение => Topic started by: arvind.k@propixtech.com on July 31, 2018, 03:53:22 PM

Title: Graphical Report
Post by: arvind.k@propixtech.com 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 ?
Title: Re: Graphical Report
Post by: Subst 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
Title: Re: Graphical Report
Post by: cwl on November 19, 2018, 11:45:20 AM
Hi,how to export a QCahrtView to the report ,thank u very much
Title: Re: Graphical Report
Post by: Arin Alex 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;
   }
Title: Re: Graphical Report
Post by: cwl 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.
Title: Re: Graphical Report
Post by: cwl 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);
Title: Re: Graphical Report
Post by: Arin Alex 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.
Title: Re: Graphical Report
Post by: cwl on November 23, 2018, 09:54:38 AM
Alex , thank you ! Looking forward to your solution.
Title: Re: Graphical Report
Post by: cwl on November 26, 2018, 04:05:44 AM
Hi Alex, could current version solve the problem. thank u!